# fatf.utils.array.tools.structured_to_unstructured¶

fatf.utils.array.tools.structured_to_unstructured(structured_array: numpy.ndarray, **kwargs) → numpy.ndarray[source]

Calls either local or numpy’s structured_to_unstructured function.

numpy 1.16.0 has introduced numpy.lib.recfunctions.structured_to_unstructured function. To ensure backwards compatibility up to numpy 1.9.0 this package implements its own version of this function (fatf.utils.array.tools.fatf_structured_to_unstructured). This function calls the latter if numpy version below 1.16.0 is installed. However, if numpy 1.16.0 or above is detected, numpy’s implementation is used instead.

For the description of structured_to_unstructured functionality either refer to the corresponding numpy (numpy.lib.recfunctions.structured_to_unstructured) or local (fatf.utils.array.tools.fatf_structured_to_unstructured) documentation.

Warning

Since this function either calls a local implementation or a builtin numpy function there may be some inconsistencies in its behaviour. One that we are aware of is conversion of arrays that contain 'V' – raw data (void), 'O' – (Python) objects, 'M' – datetime or 'm' – timedelta dtypes. These types are not supported by the local implementation, however some of them are supported by the numpy built-in, e.g. the 'V' type.

Parameters
structured_arraynumpy.ndarray

A structured numpy array to be converted into a plane numpy array.

**kwargsOptional[numpy.dtype]

Named parameters that are passed to the appropriate structured to unstructured array converter. These parameters are ignored when calling the local implementation (fatf.utils.array.tools.fatf_structured_to_unstructured).

Returns
classic_arraynumpy.ndarray

A classic numpy array representation of the structured_array with the most generic type out of the input array’s dtypes.