I have a dataset which looks something like this:
ID DATE TAG
S3800 1999-07-02 D
S1190 1999-07-02 C
S3131 1999-07-02 C
S3131 1999-07-04 C
S3131 1999-07-05 D
I am trying to calculate the minimum and maximum time gap between records for each ID(in days). For example:
ID MIN_TIME_GAP MAX_TIME_GAP
S3131 1 3
The column DATE is in format datetine64[ns]. How do I achieve this in Pandas?