# Examples from pyvista.DataSetAttributes
# =======================================

# Store data with point association in a DataSet.
import pyvista as pv
mesh = pv.Cube()
mesh.point_data['my_data'] = range(mesh.n_points)
data = mesh.point_data['my_data']
data

# Change the data array and show that this is reflected in the DataSet.
data[:] = 0
mesh.point_data['my_data']

# Remove the array.
del mesh.point_data['my_data']
'my_data' in mesh.point_data

# Print the available arrays from dataset attributes.
import numpy as np
mesh = pv.Plane(i_resolution=1, j_resolution=1)
mesh.point_data.set_array(range(4), 'my-data')
mesh.point_data.set_array(range(5, 9), 'my-other-data')
vectors0 = np.random.default_rng().random((4, 3))
mesh.point_data.set_vectors(vectors0, 'vectors0')
vectors1 = np.random.default_rng().random((4, 3))
mesh.point_data.set_vectors(vectors1, 'vectors1')
mesh.point_data

# ----------------------------------------------------------------------
# Generated by sphinx-examples-as-code https://github.com/pyvista/sphinx-examples-as-code

