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

Combine multiple columns when aggregating #1214

Open
JulienCarrau opened this issue May 24, 2023 · 2 comments
Open

Combine multiple columns when aggregating #1214

JulienCarrau opened this issue May 24, 2023 · 2 comments

Comments

@JulienCarrau
Copy link

I didn't find a way to do it while aggregating. Instead I first combine the columns I want and then I aggregate which is quite longer to code.

For instance if I have a table with a column containing items with prices and reductions in different countries and I want to group by item id. The aggregation I want is for instance a string join with the reduced price and the country.

| Item Id | Price | Reduction | Country |
| 1 | 10 | 0.25 | India |
| 1 | 20 | 0.1 | UK |

And I want to have the result as:
| Item Id | Aggregated
| 1 | 7.5 [India], 18 [UK]

So I'm looking for an aggregation method about to take multiple columns with different types and to combine all of them in one column.

Thanks in advance for your help, the library is really well done and very fast!

@lwhite1
Copy link
Collaborator

lwhite1 commented May 24, 2023 via email

@JulienCarrau
Copy link
Author

Ok! Exactly like I did. Thank you for your answer, I was just wondering if I was doing it the right way :)

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

2 participants