Movatterモバイル変換


[0]ホーム

URL:


SciPy

numpy.ogrid

numpy.ogrid = <numpy.lib.index_tricks.nd_grid object>

nd_grid instance which returns an open multi-dimensional “meshgrid”.

An instance ofnumpy.lib.index_tricks.nd_grid which returns an open(i.e. not fleshed out) mesh-grid when indexed, so that only one dimensionof each returned array is greater than 1. The dimension and number of theoutput arrays are equal to the number of indexing dimensions. If the steplength is not a complex number, then the stop is not inclusive.

However, if the step length is acomplex number (e.g. 5j), thenthe integer part of its magnitude is interpreted as specifying thenumber of points to create between the start and stop values, wherethe stop valueis inclusive.

Returns:
mesh-grid `ndarrays` with only one dimension :math:`neq 1`

See also

np.lib.index_tricks.nd_grid
class ofogrid andmgrid objects
mgrid
likeogrid but returns dense (or fleshed out) mesh grids
r_
array concatenator

Examples

>>>fromnumpyimportogrid>>>ogrid[-1:1:5j]array([-1. , -0.5,  0. ,  0.5,  1. ])>>>ogrid[0:5,0:5][array([[0],        [1],        [2],        [3],        [4]]), array([[0, 1, 2, 3, 4]])]

Previous topic

numpy.mgrid

Next topic

numpy.diag

Quick search

  • © Copyright 2008-2018, The SciPy community.
  • Last updated on Jul 24, 2018.
  • Created usingSphinx 1.6.6.

[8]ページ先頭

©2009-2025 Movatter.jp