How to do a groupby of a Ray dataset using two keys?

import pandas as pd
import ray
ray.init()

rdf = ray.data.from_pandas(pd.DataFrame({'A':[1,2,3],'B':[1,1,4],'Sales':[20,30,40]})

Let’s say I want to groupby A and B and calc the sum of Sales? How should I go about it?
Using rdf.groupby([‘A’,‘B’]) seems to be not allowed?

Hi @Pranesh, welcome to Ray community!

I guess this is the same question from Stackoverflow: python - How to do a groupby of a Ray dataset using two keys? - Stack Overflow. Let me know if that helps or if you have more questions :slight_smile:

Hello @jianxiao , Yes that was helpful. Thank you!