-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
bugSomething isn't workingSomething isn't working
Milestone
Description
Hello,
Can I reshape a long data frame to a wide data frame filling missing element with nil
?
When I have long data frame such as:
df = DataFrame.new(
names: %w[name1 name1 name1 name2 name2 name3 name3 name3],
NAME: %w[One Two Three One Three One Two Three],
VALUE: [1.1, 2.1, 3.1, 1.2, 3.2, 1.3, 2.3, 3.3]
)
I want wide data frame as:
wide = DataFrame.new(
names: %w[name1 name2 name3],
One: [1.1, 1.2, 1.3],
Two: [2.1, nil, 2.3],
Three: [3.1, 3.2, 3.3]
)
How can I do this? to_wide
raises error: #to_wide with missing values(DataFrameReshapingTest::to_wide): IndexError: element size differs (3 should be 4)
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working