numpy array sorting weirdness

MRAB google at mrabarnett.plus.com
Sun Mar 29 04:45:42 CEST 2009


Daniel Fetchinson wrote:
> So far I was working under the assumption that the numpy array
> implementation can be used as a drop-in replacement for native python
> lists, i.e. wherever I see a list 'a' and I want to speed up my
> numerical calculations I just replace it with 'numpy.array( a )' and
> everything will work just as before. It took me about half a day to
> track down a bug which was a result of this assumption being wrong.
> 
Who was it who said "Assumption is the mother of all screw-ups"? :-)

> The fact that the following two outputs are not the same is a bug or a
> feature of numpy?
> 
Well, it's in the documentation:

http://numpy.scipy.org/numpydoc/numpy-9.html#pgfId-66636



More information about the Python-list mailing list