I have a series that looks like this:
delivery
2007-04-26 706 23
2007-04-27 705 10706 1089708 83710 13712 51802 4806 1812 3
2007-04-29 706 39708 4712 1
2007-04-30 705 3706 1016707 2
...
2014-11-04 1412 531501 11502 11512 1
2014-11-05 1411 471412 13341501 401502 4331504 1261506 1001508 71510 61512 511604 11612 5
Length: 26255, dtype: int64
where the query is: df.groupby([df.index.date, 'delivery']).size()
For each day, I need to pull out the delivery number which has the most volume. I feel like it would be something like:
df.groupby([df.index.date, 'delivery']).size().idxmax(axis=1)
However, this just returns me the idxmax for the entire dataframe; instead, I need the second-level idmax (not the date but rather the delivery number) for each day, not the entire dataframe (ie. it returns a vector).
Any ideas on how to accomplish this?