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

add sotring support for unstack #3334

Open
bkamins opened this issue May 19, 2023 · 1 comment · May be fixed by #3395
Open

add sotring support for unstack #3334

bkamins opened this issue May 19, 2023 · 1 comment · May be fixed by #3395
Milestone

Comments

@bkamins
Copy link
Member

bkamins commented May 19, 2023

I thought it is not needed, but now I think it is 😄.

@bkamins bkamins added this to the 1.6 milestone May 19, 2023
@bkamins
Copy link
Member Author

bkamins commented Jun 22, 2023

Example:

julia> df = DataFrame(x=rand(1:3, 10), y=rand(1:3, 10), z=rand(10))
10×3 DataFrame
 Row │ x      y      z
     │ Int64  Int64  Float64
─────┼────────────────────────
   1 │     3      2  0.975774
   2 │     2      2  0.437708
   3 │     1      3  0.683004
   4 │     1      1  0.998265
   5 │     3      2  0.744942
   6 │     2      3  0.735679
   7 │     1      3  0.337943
   8 │     3      1  0.471394
   9 │     3      2  0.477417
  10 │     2      3  0.811261

julia> unstack(df, :x, :y, :z, combine=length)
3×4 DataFrame
 Row │ x      2        3        1
     │ Int64  Int64?   Int64?   Int64?
─────┼──────────────────────────────────
   1 │     3        3  missing        1
   2 │     2        1        2  missing
   3 │     1  missing        2        1

now we present results in the order of appearance, and it is natural that user might want rows or columns (or both) to be sorted.

@bkamins bkamins modified the milestones: 1.6, 1.7 Jul 10, 2023
@bkamins bkamins linked a pull request Oct 21, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant