str2d.Str2D.parse

classmethod Str2D.parse(data: Any | None = None, **kwargs) Str2D[source]

Parse the input data into a structured array. This is the main method that will take the input data and convert it into a structured array with fields ‘char’ and ‘alpha’. The input data can be a string, a structured array, a boolean array, a DataFrame, a Series, or an iterable. If the input data is a structured array, the keyword arguments will be ignored.

Parameters:
  • data (Optional[Any], optional) – The input data, by default None.

  • kwargs (dict) – Additional keyword arguments to pass to the struct_array_from_string method. If the input data is a structured array, these keyword arguments will be ignored.

Returns:

A structured array with fields ‘char’ and ‘alpha’ created from the input data.

Return type:

np.ndarray