summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2023-05-14 14:33:36 -0600
committerGitHub <noreply@github.com>2023-05-14 14:33:36 -0600
commitb8a43cb809edd754044af4aadfb9295915333b98 (patch)
treeefc4ac843e53c541c75f2d80cc0320e1433ed25e
parent8295ab38514a4015ef89c6e14b15403b9aa7e141 (diff)
parent22b87653d8c0a809c9da1227b2afb8ad6c79d054 (diff)
downloadnumpy-b8a43cb809edd754044af4aadfb9295915333b98.tar.gz
Merge pull request #23727 from F3eQnxN3RriK/doc-patch-2
DOC: Rewrite docstrings of `ogrid` and `mgrid`
-rw-r--r--numpy/lib/index_tricks.py28
1 files changed, 13 insertions, 15 deletions
diff --git a/numpy/lib/index_tricks.py b/numpy/lib/index_tricks.py
index 1da73dee5..6913d2b95 100644
--- a/numpy/lib/index_tricks.py
+++ b/numpy/lib/index_tricks.py
@@ -210,13 +210,13 @@ class nd_grid:
class MGridClass(nd_grid):
"""
- `nd_grid` instance which returns a dense multi-dimensional "meshgrid".
+ An instance which returns a dense multi-dimensional "meshgrid".
- An instance of `numpy.lib.index_tricks.nd_grid` which returns an dense
- (or fleshed out) mesh-grid when indexed, so that each returned argument
- has the same shape. The dimensions and number of the output arrays are
- equal to the number of indexing dimensions. If the step length is not a
- complex number, then the stop is not inclusive.
+ An instance which returns a dense (or fleshed out) mesh-grid
+ when indexed, so that each returned argument has the same shape.
+ The dimensions and number of the output arrays are equal to the
+ number of indexing dimensions. If the step length is not a complex
+ number, then the stop is not inclusive.
However, if the step length is a **complex number** (e.g. 5j), then
the integer part of its magnitude is interpreted as specifying the
@@ -229,8 +229,7 @@ class MGridClass(nd_grid):
See Also
--------
- lib.index_tricks.nd_grid : class of `ogrid` and `mgrid` objects
- ogrid : like mgrid but returns open (not fleshed out) mesh grids
+ ogrid : like `mgrid` but returns open (not fleshed out) mesh grids
meshgrid: return coordinate matrices from coordinate vectors
r_ : array concatenator
:ref:`how-to-partition`
@@ -262,13 +261,13 @@ mgrid = MGridClass()
class OGridClass(nd_grid):
"""
- `nd_grid` instance which returns an open multi-dimensional "meshgrid".
+ An instance which returns an open multi-dimensional "meshgrid".
- An instance of `numpy.lib.index_tricks.nd_grid` which returns an open
- (i.e. not fleshed out) mesh-grid when indexed, so that only one dimension
- of each returned array is greater than 1. The dimension and number of the
- output arrays are equal to the number of indexing dimensions. If the step
- length is not a complex number, then the stop is not inclusive.
+ An instance which returns an open (i.e. not fleshed out) mesh-grid
+ when indexed, so that only one dimension of each returned array is
+ greater than 1. The dimension and number of the output arrays are
+ equal to the number of indexing dimensions. If the step length is
+ not a complex number, then the stop is not inclusive.
However, if the step length is a **complex number** (e.g. 5j), then
the integer part of its magnitude is interpreted as specifying the
@@ -282,7 +281,6 @@ class OGridClass(nd_grid):
See Also
--------
- np.lib.index_tricks.nd_grid : class of `ogrid` and `mgrid` objects
mgrid : like `ogrid` but returns dense (or fleshed out) mesh grids
meshgrid: return coordinate matrices from coordinate vectors
r_ : array concatenator