A new 1-D array initialized from text data in a string.
For full documentation refer to numpy.fromstring.
string (str) -- A string containing the data.
dtype ({None, str, dtype object}, optional) -- The data type of the array. For binary input data, the data must be in exactly this format. Default is the default floating point data type for the device where the returned array is allocated.
count (int, optional) -- Read this number of dtype elements from the data. If this is negative (the default), the count will be determined from the length of the data.
sep (str, optional) -- The string separating numbers in the data; extra whitespace between elements is also ignored.
device ({None, string, SyclDevice, SyclQueue, Device}, optional) --
An array API concept of device where the output array is created.
device can be None, a oneAPI filter selector string, an instance
of dpctl.SyclDevice corresponding to a non-partitioned SYCL
device, an instance of dpctl.SyclQueue, or a
dpctl.tensor.Device object returned by
dpnp.ndarray.device.
Default: None.
usm_type ({None, "device", "shared", "host"}, optional) -- The type of SYCL USM allocation for the output array.
Default: "device".
sycl_queue ({None, SyclQueue}, optional) -- A SYCL queue to use for output array allocation and copying. The
sycl_queue can be passed as None (the default), which means
to get the SYCL queue from device keyword if present or to use
a default queue.
Default: None.
out -- The constructed array.
dpnp.ndarray
Limitations
Parameter like is supported only with default value None.
Otherwise, the function raises NotImplementedError exception.
Notes
This uses numpy.fromstring and coerces the result to a DPNP array.
See also
dpnp.frombufferConstruct array from the buffer data.
dpnp.fromfileConstruct array from data in a text or binary file.
dpnp.fromiterConstruct array from an iterable object.
Examples
>>> import dpnp as np
>>> np.fromstring('1 2', dtype=int, sep=' ')
array([1, 2])
>>> np.fromstring('1, 2', dtype=int, sep=',')
array([1, 2])