0

I have a datetime column that looks like the following:

DELIVERY_DUE_BY_CUSTOM_REFERENCE

And a "market" column that has sting values such as ['NYC', LA', 'HOU', etc.] I also have a column "ID" that has random Order IDs. I am trying to look at each market by day (data goes back 5 months) and count the number of IDs that occur before noon and the number that occur after noon. My first step was to groupby market and date, but I don't know how to 1) break up date into day and hour (so I can group it further) or 2) shortcut that and find a way to just count Order IDs for everyday before noon and after noon (will need two new columns)

My attempt is below... the issue is that it's keeping the hhmmss on the date column.

Attempt to group by day

I've also tried to resample by D and H, but that isn't doing the trick for me yet... Attempt to resample

Can anyone help me groupby market and day, then count Order IDs that occur before noon in one field and after noon in a second field?

0 Answers0