Skip to content

Tag: python

Calculate TimeDiff in Pandas based on a column values

Having a dataframe like that: Desirable result is to get aggregated IDs with time diffs between Start and End looking like that: Tried simple groupings and diffs but it does not work: How this task can be done in pandas? Thanks! Answer A possible solution is to join the table on itself like this: Output: