This is a pre-release version (2.5.0.dev0+git20251130.2de293a). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy 2.5.0.dev0+git20251130.2de293a / numpy / lib / _index_tricks_impl / OGridClass

class

numpy.lib._index_tricks_impl:OGridClass

source: build-install/usr/lib/python3.14/site-packages/numpy/lib/_index_tricks_impl.py :273

Signature

class   OGridClass ( )

Members

Summary

An instance which returns an open multi-dimensional "meshgrid".

Extended Summary

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 number of points to create between the start and stop values, where the stop value is inclusive.

Returns

mesh-grid : ndarray or tuple of ndarrays

If the input is a single slice, returns an array. If the input is multiple slices, returns a tuple of arrays, with only one dimension not equal to 1.

Examples

from numpy import ogrid
ogrid[-1:1:5j]
ogrid[0:5, 0:5]

See also

how-to-partition

ref

meshgrid

return coordinate matrices from coordinate vectors

mgrid

like ogrid but returns dense (or fleshed out) mesh grids

r_

array concatenator

Aliases

  • numpy.lib._index_tricks_impl.OGridClass