pandas 删除至少有一个零值的行

xmjla07d  于 2022-12-16  发布在  其他
关注(0)|答案(1)|浏览(201)

这是我的数据框

Param1                 Param2    datetime
ts                                                                            
1669246574000               6.06                  -1.80  22-24-11 01:36:14 UTC
1669242973000               6.50                  -1.73  22-24-11 00:36:13 UTC
...                          ...                    ...                    ...
1668918964000               6.00                   0.00  22-20-11 06:36:04 UTC
1668915364000               0.00                   1.6   22-20-11 05:36:04 UTC

已删除零值的输出

Param1                 Param2    datetime
ts                                                                            
1669246574000               6.06                  -1.80  22-24-11 01:36:14 UTC
1669242973000               6.50                  -1.73  22-24-11 00:36:13 UTC
brgchamk

brgchamk1#

尝试这样做:
df[(df != 0).all(1)]

df[df != 0].dropna()

相关问题