pyvista.DataSet.rename_array#
- DataSet.rename_array(old_name: str, new_name: str, preference='cell') None [source]#
Change array name by searching for the array then renaming it.
- Parameters:
Examples
Create a cube, assign a point array to the mesh named
'my_array'
, and rename it to'my_renamed_array'
.>>> import pyvista as pv >>> import numpy as np >>> cube = pv.Cube() >>> cube['my_array'] = range(cube.n_points) >>> cube.rename_array('my_array', 'my_renamed_array') >>> cube['my_renamed_array'] pyvista_ndarray([0, 1, 2, 3, 4, 5, 6, 7])