Hi everyone,

Ah, I neglected to see that the PR was already merged. In any case, I’ll repeat 
my comment here (referring to the indexing section):

I would suggest that this section be removed entirely or updated. For example, 
if xis either an array scalar or a rank zero array, x[...] is guaranteed to be 
an array and x[()]is guaranteed to be a scalar. The difference is because 
x[{anything here}, ...] is guaranteed to be an array. In words, if the last 
index is an ellipsis, the result of indexing is guaranteed to be an array.

I came across this weird behaviour when implementing the equivalent of 
np.wherefor PyData/Sparse.

Best Regards,
Hameer Abbasi

> On Wednesday, Oct 17, 2018 at 7:59 PM, Matti Picus <matti.pi...@gmail.com 
> (mailto:matti.pi...@gmail.com)> wrote:
> In PR 12166 https://github.com/numpy/numpy/pull/12166 we revived an old
> wiki document discussing the implementation of 0-dimensional arrays.
> This became informational NEP-27
> http://www.numpy.org/neps/nep-0027-zero-rank-arrarys.html. There was
> fruitful discussion of the NEP and the need for both 0-D arrays and
> scalars on the PR comments. The NEP itself is informational and freezes
> the information to the 2006 discussion, noting that "some of the
> information here is dated, for instance indexing of 0-D arrays now is
> now implemented and does not error."
>
>
> I would like to submit the NEP for discussion and approval.
>
> Matti
>
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion@python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@python.org
https://mail.python.org/mailman/listinfo/numpy-discussion

Reply via email to