Back to Numerical Arrays (NumPy)

np.fromstring

Create a 1D array from text data in a string.

Syntax

np.fromstring(string, sep?, count?, options?)

Description

Create a 1D array from text data in a string. A simple way to quickly create 1D arrays from raw text. The string is parsed using a separator character.

Parameters

NameDescription
string- String containing the data
sep(optional)- Separator between data items. If empty string, treats the string as binary data with each character representing a byte.
count(optional)- Number of items to read. Default is -1 (read all).
options(optional)- Optional configuration (dtype)

Returns

Promise<NDArray>