I have a dataframe df with about 1 million rows:
HOUSEID PERSONID ENDTIME STRTTIME TRVLCMIN
0 20000017 1 1020 955 25
1 20000017 1 1132 1130 2
2 20000017 1 1400 1330 30
3 20000017 2 1020 955 25
4 20000017 2 1025 1022 3
5 20000017 2 -9 1120 2
6 20000017 2 2035 2000 35
7 20000231 1 952 945 7
8 20000231 1 1000 -9 5
9 20000231 2 2013 2002 -9
Each row is a trip made by a person. And each unique combination of HOUSEID and PERSONID is a person.
I want to delete a person entirely if there is a "-9" in even one of the trips of these columns ENDTIME, STRTTIME and TRVLCMIN.
Here is the output of my dataframe by this explanation:
HOUSEID PERSONID ENDTIME STRTTIME TRVLCMIN
0 20000017 1 1020 955 25
1 20000017 1 1132 1130 2
2 20000017 1 1400 1330 30
Can you help me with that?
I very much appreciate your time.