pysdic.PointCloud.is_nan#
- PointCloud.is_nan()[source]#
Check which points in the point cloud are NaN.
This method returns a boolean mask indicating which points in the point cloud contain NaN values.
See also
all_finite()method for checking if all points are finite.is_finite()method for getting a boolean mask of finite points.
- Returns:
A 1D boolean NumPy array of shape \((N_p,)\) where \(N_p\) is the number of points in the point cloud. Each element is True if the corresponding point contains any NaN value, and False otherwise.
- Return type:
Examples
Create a
PointCloudfrom a NumPy array containing some NaN values.1import numpy as np 2from pysdic import PointCloud 3 4# Create a point cloud with some NaN values 5points = np.array([[0.0, 1.0, 2.0], 6 [np.nan, 1.0, 2.0], 7 [3.0, 4.0, 5.0], 8 [6.0, np.nan, 8.0]]) 9point_cloud = PointCloud.from_array(points)
Check which points are NaN using the
is_nan()method.1nan_mask = point_cloud.is_nan() 2print(nan_mask) 3# Output: [False True False True]