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

Sort order in summarytable and listingtable when groups are missing #25

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

jkrumbiegel
Copy link
Collaborator

Fixes #22

This sorts the row groups and column groups separately, so sort order in each of those isn't affected by whether all combinations exist.

julia> df = DataFrame(value = ones(6), A = ['c', 'c', 'c', 'b', 'b', 'a'], B = [4, 2, 8, 2, 4, 4])
6×3 DataFrame
 Row │ value    A     B     
     │ Float64  Char  Int64 
─────┼──────────────────────
   11.0  c         4
   21.0  c         2
   31.0  c         8
   41.0  b         2
   51.0  b         4
   61.0  a         4

julia> summarytable(df, :value, rows = :A, cols = :B, summary = [sum])

Before:

image

After:

image

@jkrumbiegel jkrumbiegel merged commit b36aa31 into master Sep 16, 2024
5 checks passed
@jkrumbiegel jkrumbiegel deleted the jk/sort-order-with-missing-groups branch September 16, 2024 09:10
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

Successfully merging this pull request may close these issues.

Sorting by column group
1 participant