Get count of value for 15 min periods
I have a DataFrame with a DateTimeIndex. I would like to get the count of all different (integer) values for column col1 for each 15 min period.
I have looked at groupby and count but this doesn't seem to work.
Any suggestion appreciated!
result = df.groupby(pd.TimeGrouper('15Min')['col1'].apply(lambda x: x.value_counts()))
should do the trick.