Skip to main content
`Ctrl`+`K`

# numpy.ma.flatten_structured_array

ma.flatten_structured_array(a)

  Flatten a structured array.

  The data type of the output is chosen such that it can represent all of the (nested) fields.

  Parameters:
    a structured array
  Returns:
    output masked array or ndarray

      A flattened masked array if the input is a masked array, otherwise a standard ndarray.

  Examples

      >>> import numpy as np
      >>> ndtype = [('a', int), ('b', float)]
      >>> a = np.array([(1, 1), (2, 2)], dtype=ndtype)
      >>> np.ma.flatten_structured_array(a)
      array([[1., 1.],
             [2., 2.]])