Skip to content

Tag: pandas

Duration between two timestamps

I have a dataframe with different timestamp for each user, and I want to calculate the duration. I used this code to import my CSV files: df.head() And I want to get something like that I’ve used this code, but doesn’t work for me Answer Operations which occur over groups of values are GroupBy ope…

Calculating the number of starts, by customer using Pandas

I have DataFrame that looks like: df I’m trying to calculate the beginning and end date for each, which I think is pretty straight forward (i.e., first time each customer customer and last time, as defined by amt > 0). What I need help with is calculating the number of new acquisitions, whether it&#8…