-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: df.explode mulitcol with Nan+emptylist #49680
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
BUG: df.explode mulitcol with Nan+emptylist #49680
Conversation
@@ -280,3 +280,24 @@ def test_multi_columns(input_subset, expected_dict, expected_index): | |||
result = df.explode(input_subset) | |||
expected = pd.DataFrame(expected_dict, expected_index) | |||
tm.assert_frame_equal(result, expected) | |||
|
|||
|
|||
def test_multi_columns2(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you give a better name
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
"C": [1, 2, np.nan, np.nan, 3, 4], | ||
}, | ||
index=[0, 0, 1, 2, 3, 3], | ||
).astype({"A": object, "C": object}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you avoid the astype call?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. used np.array to set dtype of the cols
Thanks @debnathshoham |
* BUG: df.explode mulitcol with Nan+emptylist * suggested changes
* BUG: df.explode mulitcol with Nan+emptylist * suggested changes
doc/source/whatsnew/v2.0.0.rst
file if fixing a bug or adding a new feature.