go-gota / gota

Gota: DataFrames and data wrangling in Go (Golang)
Other
2.97k stars 276 forks source link

Question: How to do GroupBy with TopN items? #179

Open mrichman opened 2 years ago

mrichman commented 2 years ago

I have a dataframe that looks like this:

Name,Color,Price
Foo,Blue,2
Foo,Red,4
Foo,Black,5
Bar,Green,4
Bar,Yellow,0
Bar,Orange,1
Qux,Blue,2
Qux,Red,4
Qux,Black,5

I'd like to group these by (Name,Color) and then take the top N (Price). How can I do this?