FunctionRacerProblemsRace

Colour Tally

BeginnerpandasPython

shirts has columns id and colour (text). Return a dictionary mapping each colour to the number of shirts with that colour (an int).

Example 1

shirts {"id":[1,2,3],"colour":["red","blue","red"]}
returns {"red":2,"blue":1}

red appears twice, blue once.

Constraints

Race itor take your time

Write it in your browser, against the clock. The model solution, stepped through line by line, comes after.

More pandas problems