[Numpy-discussion] non-integer index misfeature?

Neal Becker ndbecker2@gmail....
Tue Dec 11 10:44:26 CST 2012


I think it's a misfeature that a floating point is silently accepted as an 
index.  I would prefer a warning for:

bins = np.arange (...)

for b in bins:
...
  w[b] = blah

when I meant:

for ib,b in enumerate (bins):
  w[ib] = blah



More information about the NumPy-Discussion mailing list