我在pandas中有一个数据框,其中包含以下列。 A,B,C,D,X,y,z
如果A,B,C,D的所有4列值均为null,我想从数据框中删除行。 如何实现呢?
答案 0 :(得分:0)
您可以使用import numpy as np
import open3d as o3d
# Load binary point cloud
bin_pcd = np.fromfile("lidar_velodyne64.bin", dtype=np.float32)
# Reshape and drop reflection values
points = bin_pcd.reshape((-1, 4))[:, 0:3]
# Convert to Open3D point cloud
o3d_pcd = o3d.geometry.PointCloud(o3d.utility.Vector3dVector(points))
# Save to whatever format you like
o3d.io.write_point_cloud("pointcloud.pcd", o3d_pcd)
进行此操作:
dropna(how='all')
答案 1 :(得分:0)
赞:
df = df.dropna(subset=['A', 'B', 'C', 'D'])