pyvista.DataObject.field_data#

property DataObject.field_data: DataSetAttributes[source]#

Return FieldData as DataSetAttributes.

Use field data when size of the data you wish to associate with the dataset does not match the number of points or cells of the dataset.

Returns:
DataSetAttributes

FieldData as DataSetAttributes.

Examples

Add field data to a PolyData dataset and then return it.

>>> import pyvista as pv
>>> import numpy as np
>>> mesh = pv.Sphere()
>>> mesh.field_data['my-field-data'] = np.arange(10)
>>> mesh.field_data['my-field-data']
pyvista_ndarray([0, 1, 2, 3, 4, 5, 6, 7, 8, 9])