[Numpy-discussion] take behaviour has changed

Travis Oliphant oliphant.travis at ieee.org
Fri Sep 22 22:31:55 CDT 2006


Christian Kristukat wrote:
>>> Ok. Does axis=None then mean, that take(a, ind) operates on the
>>> flattened array?
>>>       
Yes, that is correct.

> Sorry, I never really read about what are ufuncs. I thought those are class
> methods of the ndarray objects... Anyway, I was refering to the following
> difference:
>   
> In [7]: a
> Out[7]:
> array([[ 0,  1,  2,  3,  4,  5],
>        [ 6,  7,  8,  9, 10, 11]])
>
> In [8]: a.take([0])
> Out[8]: array([[0, 1, 2, 3, 4, 5]])
>
> In [9]: take(a,[0])
> Out[9]: array([0])
>   
Doh!.   That is a bug.  take(a,[0]) is correct a.take([0]) is not correct.

-Travis





More information about the Numpy-discussion mailing list