You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`Ellipsis` expands to make the selection tuple be consistent with the
number of dimensions of the array being indexed. The length of the
expanded selection tuple may not be equal to the number of dimensions
in the array due to `newaxis` objects or advanced indexing. This
commit fixes the docs to correctly explain the behavior of `Ellipsis`.
For example,
```python
>>> import numpy as np
>>> x = np.zeros((3, 3, 3))
>>> x[:, ..., :2, np.newaxis].shape
(3, 3, 2, 1)
>>> x[:, :, :2, np.newaxis].shape
(3, 3, 2, 1)
```
The `Ellipsis` expands to a single `:` so that the selection tuple can
index the 3-D array. The length of the expanded selection tuple is 4,
not 3 as the docs indicated before this commit.
0 commit comments