pyvista.core._validation.check.check_real#
- check_real(array: _ArrayLikeOrScalar[NumberType], /, *, name: str = 'Array') None [source]#
Check if an array has real numbers, i.e. float or integer type.
- Parameters:
- Raises:
TypeError
If the array does not have real numbers.
See also
check_integer
Similar function for integer arrays.
check_number
Similar function for scalar values.
check_finite
Check for finite values.
Notes
Boolean data types are not considered real and will raise an error.
Arrays with
infinity
orNaN
values are considered real and will not raise an error. Usecheck_finite()
to check for finite values.
Examples
Check if an array has real numbers.
>>> from pyvista import _validation >>> _validation.check_real([1, 2, 3])