Allowing 0-d arrays in np.take

Dec. 4, 2012
1:57 p.m.
Hey, Maybe someone has an opinion about this (since in fact it is new behavior, so it is undefined). `np.take` used to not allow 0-d/scalar input but did allow any other dimensions for the indices. Thinking about changing this, meaning that: np.take(np.arange(5), 0) works. I was wondering if anyone has feelings about whether this should return a scalar or a 0-d array. Typically numpy prefers scalars for these cases (indexing would return a scalar too) for good reasons, so I guess that is correct. But since I noticed this wondering if maybe it returns a 0-d array, I thought I would ask here. Regards, Sebastian

4562
Age (days ago)
4562
Last active (days ago)
1 comments
2 participants
participants (2)
-
Benjamin Root
-
Sebastian Berg