j***@gmail.com
2015-07-01 14:05:23 UTC
About the deprecation warning for using another type than integers, in
ones, reshape, indexing and so on:
Wouldn't it be nicer to accept floats that are equal to an integer?
for example
or the python 2 version
I'm using now 10 // 2, or int(10./2 + 1) but this is unconditional and
doesn't raise if the numbers are not close or equal to an integer (which
would be a bug)
Josef
ones, reshape, indexing and so on:
Wouldn't it be nicer to accept floats that are equal to an integer?
for example
5.0 == 5
Truenp.ones(10 / 2)
array([ 1., 1., 1., 1., 1.])10 / 2 == 5
Trueor the python 2 version
np.ones(10. / 2)
array([ 1., 1., 1., 1., 1.])10. / 2 == 5
TrueI'm using now 10 // 2, or int(10./2 + 1) but this is unconditional and
doesn't raise if the numbers are not close or equal to an integer (which
would be a bug)
Josef