dpnp.array
- dpnp.array(x1, dtype=None, copy=True, order='C', subok=False, ndmin=0, like=None, device=None, usm_type=None, sycl_queue=None)[source]
Creates an array.
For full documentation refer to
numpy.array
.Limitations
Parameter
subok
is supported only with default valueFalse
. Parameterndmin
is supported only with default value0
. Parameterlike
is supported only with default valueNone
.See also
dpnp.empty_like
Return an empty array with shape and type of input.
dpnp.ones_like
Return an array of ones with shape and type of input.
dpnp.zeros_like
Return an array of zeros with shape and type of input.
dpnp.full_like
Return a new array with shape of input filled with value.
dpnp.empty
Return a new uninitialized array.
dpnp.ones
Return a new array setting values to one.
dpnp.zeros
Return a new array setting values to zero.
dpnp.full
Return a new array of given shape filled with value.
Examples
>>> import dpnp as np >>> x = np.array([1, 2, 3]) >>> x.ndim, x.size, x.shape (1, 3, (3,)) >>> print(x) [1 2 3]
More than one dimension:
>>> x2 = np.array([[1, 2], [3, 4]]) >>> x2.ndim, x2.size, x2.shape (2, 4, (2, 2)) >>> print(x2) [[1 2] [3 4]]