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
subokis supported only with default valueFalse. Parameterndminis supported only with default value0. Parameterlikeis supported only with default valueNone.See also
dpnp.empty_likeReturn an empty array with shape and type of input.
dpnp.ones_likeReturn an array of ones with shape and type of input.
dpnp.zeros_likeReturn an array of zeros with shape and type of input.
dpnp.full_likeReturn a new array with shape of input filled with value.
dpnp.emptyReturn a new uninitialized array.
dpnp.onesReturn a new array setting values to one.
dpnp.zerosReturn a new array setting values to zero.
dpnp.fullReturn 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]]