pyvista.convert_array#
- convert_array(arr, name=None, deep=False, array_type=None)[source]#
Convert a NumPy array to a vtkDataArray or vice versa.
- Parameters:
- arr
np.ndarray
|vtkDataArray
A numpy array or vtkDataArry to convert.
- name
str
,optional
The name of the data array for VTK.
- deepbool, default:
False
If input is numpy array then deep copy values.
- array_type
int
,optional
VTK array type ID as specified in
vtkType.h
.
- arr
- Returns:
vtkDataArray
ornumpy.ndarray
The converted array. If input is a
numpy.ndarray
then returnsvtkDataArray
or is input isvtkDataArray
then returns NumPyndarray
.