我的熊猫数据框如下所示:
col_1 | col_2 | col_3 .... col_100
date
01-01-2001 True False False ... True
02-01-2001 False True False ... True
03-01-2001 True False True ... True
04-01-2001 False False False ... False
因此,我想得到一个 df,其中包含该行中至少有一个 True 的所有行。在这种情况下,结果将是
col_1 | col_2 | col_3 ... col_100
date
01-01-2001 True False False ... True
02-01-2001 False True False ... True
03-01-2001 True False True ... False
有什么聪明的方法可以做到这一点?
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句