-
Notifications
You must be signed in to change notification settings - Fork 58
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
Pivot table horizontal grouping, is it supported? #97
Comments
@koperagen Maybe we need to have the function |
If I have to group only two columns, |
Now that you mention horizontal / vertical grouping, documentation states https://kotlin.github.io/dataframe/pivot.html
According to Also, can you share this dataset if it's public? |
I see the problem, yes. Can you provide the dataset so i can give it a try myself? It would be easier for me to figure it out in REPL :) Or we can pick other dataset |
Hi, @hfazai. As far as I understand, you need hierarchical grouping of rows, so that |
Try: |
Hi @nikitinas, yes exactly :) |
I'll try it, thanks! |
Yes, sorry I was wrong I copied the last code in my tests, I mean |
Let's discuss implementation. An obvious solution is to add but will have a better presentation: nested This approach raises several questions:
I think that fair implementation of row grouping may overcomplicate |
And we also should add |
I agree with you concerns about changing the internal implementation. The solution of adding the additional informations about the row grouping looks good to me. |
I think that sorting should be performed explicitly, because in some cases original order of rows must be preserved. We can add |
Sounds good 👍 |
Thanks for creating this great library 👍 !
I follow this documentation to create a pivot table.
Is it possible to make an horizontal grouping like in this example (add gender to rows) ?
pivot { col1 then col2 } .groupBy { row1 and row2 }
col1 and c2 are grouped hierarchically but row1 and row2 are not.The text was updated successfully, but these errors were encountered: