This is a pre-release version (latest). Go to latest (2.4.4)
{ } Raw JSON

bundles / numpy latest / numpy / ma / core / flatten_structured_array

function

numpy.ma.core:flatten_structured_array

source: build-install/usr/lib/python3.14/site-packages/numpy/ma/core.py :2548

Signature

def   flatten_structured_array ( a )

Summary

Flatten a structured array.

Extended Summary

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)

Aliases

  • numpy.ma.flatten_structured_array