dpnp.atleast_2d
- dpnp.atleast_2d(*arys)[source]
View inputs as arrays with at least two dimensions.
For full documentation refer to
numpy.atleast_2d
.- Parameters:
arys ({dpnp.ndarray, usm_ndarray}) -- One or more array-like sequences. Arrays that already have two or more dimensions are preserved.
- Returns:
out -- An array, or list of arrays, each with
a.ndim >= 2
. Copies are avoided where possible, and views with two or more dimensions are returned.- Return type:
dpnp.ndarray
See also
dpnp.atleast_1d
Convert inputs to arrays with at least one dimension.
dpnp.atleast_3d
View inputs as arrays with at least three dimensions.
Examples
>>> import dpnp as np >>> x = np.array(3.0) >>> np.atleast_2d(x) array([[3.]])
>>> x = np.arange(3.0) >>> np.atleast_2d(x) array([[0., 1., 2.]])