有没有办法可以删除pandas数据帧中的所有行,其中所有列的总和等于0?
您可以更改逻辑 - 使用boolean indexing
选择sum不等于0
所有列:
df = df[df.sum(axis=1).ne(0)]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.