dpnp.linspace

dpnp.linspace(start, stop, num=50, endpoint=True, retstep=False, dtype=None, axis=0)[source]

Return evenly spaced numbers over a specified interval.

For full documentation refer to numpy.linspace.

Limitations

Parameter axis is supported only with default value 0.

See also

dpnp.arange

Similar to linspace, but uses a step size (instead of the number of samples).

dpnp.geomspace

Similar to linspace, but with numbers spaced evenly on a log scale (a geometric progression).

dpnp.logspace

Similar to geomspace, but with the end points specified as logarithms.

Examples

>>> import dpnp as np
>>> x = np.linspace(2.0, 3.0, num=5)
>>> [i for i in x]
[2.0, 2.25, 2.5, 2.75, 3.0]
>>> x2 = np.linspace(2.0, 3.0, num=5, endpoint=False)
>>> [i for i in x2]
[2.0, 2.2, 2.4, 2.6, 2.8]
>>> x3, step = np.linspace(2.0, 3.0, num=5, retstep=True)
>>> [i for i in x3], step
([2.0, 2.25, 2.5, 2.75, 3.0], 0.25)