Open JulienCarrau opened 1 year ago
There is nothing that can do all that in one step. You should probably
On Wed, May 24, 2023 at 9:47 AM Julien Carrau @.***> wrote:
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!
— Reply to this email directly, view it on GitHub https://github.com/jtablesaw/tablesaw/issues/1214, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA2FPAWRBNMYK4LDWEJ7JBTXHYGORANCNFSM6AAAAAAYNNIFQ4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Ok! Exactly like I did. Thank you for your answer, I was just wondering if I was doing it the right way :)
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!