0

Say that we have a dataframe that includes the columns "time of day" and "vehicle", which looks something like this:

  tod vehicle
0 morning Truck
1 morning Car
2 morning Car
3 afternoon Bicycle
4 afternoon Truck
5 afternoon Truck
  ...

I want to get the count of each vehicle for each time of day, keeping the labels. So, morning would give something along the lines of:

morning  Truck: 1
         Car : 2
afternoon   Bicycle : 1
            Truck : 2

How can I do this?

aikky
  • 1
  • 1

0 Answers0