I have a dataframe like this:
col.1 : a a a a a b b b c c c
col.2 : 0 0 1 0 0 0 1 0 0 0 0
I want to delete all values for the same value in column 1 after 1 occurs in col.2. The result should look like this:
col.1 : a a a b b c c c
col.2 : 0 0 1 0 1 0 0 0
Is there a way to do this fast in pandas? I am currently using numpy, where it seems to be very slow.
source
share