My pandas dataframe looks like this:
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
as a result, I'd like to get a df that contains all the rows which have at least one True in the row. In this case, the results would be
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
Any clever way to do this?
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.