Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE-REQUEST] Aggregate dict on a groupby #2272

Open
vikalfc opened this issue Nov 18, 2022 · 0 comments
Open

[FEATURE-REQUEST] Aggregate dict on a groupby #2272

vikalfc opened this issue Nov 18, 2022 · 0 comments

Comments

@vikalfc
Copy link

vikalfc commented Nov 18, 2022

When #2032 is done, it would be useful to have something like this

import vaex

df = vaex.datasets.titanic()

def custom_f(x,y):
    return {"name": x,"cabin": y}

df["content"]=df.apply(custom_f,
    arguments=[df["name"], df["cabin"]])
df_pandas=df.to_pandas_df()

df_pandas.groupby(by=['pclass', 'survived']).agg({
    'content': list}).reset_index()

Screenshot 2022-11-18 at 12 28 13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant