I have three pandas Dataframe with 3 features:
Date In, Date Out, Status
Date In/Out are timestamps. Status is a text field.
I want to know how many came in on every month and how many that went out in the same month.
I used:
d = df.resample('M', on='Date In').count()
This returns the count of Date Out matching every month of Date In's resample. However, it seems to remove the Date In column from the output, making it the index. This makes
d['Date In']
not possible to get the count of Date In
for that month. Moreover, if I had more columns, this would also show the counts of those relative to Date In. This is what makes the .resample() method so effective.
I have recently updated pandas and I think this is one of the things they changed in the newer version.