We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
DataFrame#to_wide
DataFrame#to_wide returns wrong wide table when rows are not ordered.
wide = DataFrame.new( rows: %w[row1 row2], Column1: [1.1, 1.2], Column2: [2.1, 2.2] ) wide => #<RedAmber::DataFrame : 2 x 3 Vectors, 0x00000000004422e4> rows Column1 Column2 <string> <double> <double> 0 row1 1.1 2.1 1 row2 1.2 2.2 long = wide.to_long(:rows) => #<RedAmber::DataFrame : 4 x 3 Vectors, 0x00000000004760f8> rows NAME VALUE <string> <string> <double> 0 row1 Column1 1.1 1 row1 Column2 2.1 2 row2 Column2 2.2 3 row2 Column1 1.2 long.to_wide == wide => true shuffled = long.shuffle shuffle => #<RedAmber::DataFrame : 4 x 3 Vectors, 0x0000000000516850> rows NAME VALUE <string> <string> <double> 0 row1 Column1 1.1 1 row2 Column2 2.2 2 row2 Column1 1.2 3 row1 Column2 2.1 shuffled.to_wide => #<RedAmber::DataFrame : 2 x 3 Vectors, 0x000000000052ec84> rows Column1 Column2 <string> <double> <double> 0 row1 1.1 2.1 1 row2 2.2 1.2 shuffled.to_wide == wide => false
The text was updated successfully, but these errors were encountered:
No branches or pull requests
DataFrame#to_wide
returns wrong wide table when rows are not ordered.The text was updated successfully, but these errors were encountered: