Let's say I have a table users
with thousands of records, each with their name
.
My goal is to draw a pie chart showing the most common names. I want to take, for example, the 9 most common names, and put the rest into a 'others' group.
I can't figure out how to use groupBy()
and take()
, or whatever, to achieve this.
Any ideas?