summaryrefslogtreecommitdiff
path: root/numpy/core/numeric.py
diff options
context:
space:
mode:
authorJim Turner <git@turner.link>2018-12-11 14:40:14 -0500
committerJim Turner <git@turner.link>2018-12-12 12:39:00 -0500
commit8eefc53ac9cfcd4ccc5b70ccfc900b06b389dce3 (patch)
tree969626cb6e5d0bdd7566bde9554faddf8191c48f /numpy/core/numeric.py
parentb40321f0668673c0519ce0e124427cb8d0cc3135 (diff)
downloadnumpy-8eefc53ac9cfcd4ccc5b70ccfc900b06b389dce3.tar.gz
DOC: Fix desc. of Ellipsis behavior in reference
`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.
Diffstat (limited to 'numpy/core/numeric.py')
0 files changed, 0 insertions, 0 deletions