pyvista.get_array

Contents

pyvista.get_array#

get_array(
mesh: DataSet | _vtk.vtkDataSet | _vtk.vtkTable,
name: str,
preference: PointLiteral | CellLiteral | FieldLiteral | RowLiteral = 'cell',
err: bool = False,
) pyvista_ndarray | None[source]#

Search point, cell and field data for an array.

Parameters:
meshpyvista.DataSet

Dataset to get the array from.

namestr

The name of the array to get the range.

preferencestr, default: “cell”

When scalars is specified, this is the preferred array type to search for in the dataset. Must be either 'point', 'cell', or 'field'.

errbool, default: False

Whether to throw an error if array is not present.

Returns:
pyvista.pyvista_ndarray or None

Requested array. Return None if there is no array matching the name and err=False.