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:
TypeErrorIf the array does not have real numbers.
See also
check_integerSimilar function for integer arrays.
check_numberSimilar function for scalar values.
check_finiteCheck for finite values.
Notes
Boolean data types are not considered real and will raise an error.
Arrays with
infinityorNaNvalues 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])