Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Compare Timestamps from columns and remove entries based on condition

$
0
0

I have a dataframe

df1 = Instance       sort_begin             cop_begin          ded_begina              04:19:07                04:31:56            04:32:32 a              04:19:07                02:34:22            02:34:22f              05:19:07                02:31:26            04:32:32f              04:19:17                04:35:56            04:34:35

The columns are stages in workflow with timestamps in H:M:S format, where cop_begin should begin only after sort_begin, and ded_begin after cop_begin.However, there are other rows which has wrong values where cop_begin is before sort_begin and ded_begin before cop_begin.

How can we remove such entries in dataframe ?

 Output   df =     Instance       sort_begin             cop_begin          ded_begin    a              04:19:07                04:31:56            04:32:32     f              04:19:17                04:35:56            04:37:35

Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>