-
Notifications
You must be signed in to change notification settings - Fork 917
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
Allow cudf.concat to process a dictionary of frames #15115 #15126
Changes from all commits
b16713a
586c047
f7ed7f9
23fb675
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1921,3 +1921,21 @@ def test_concat_mixed_list_types_error(s1, s2): | |
|
||
with pytest.raises(NotImplementedError): | ||
cudf.concat([s1, s2], ignore_index=True) | ||
|
||
|
||
def test_horizontal_concat_dictionary(): | ||
|
||
d = { | ||
'first': cudf.DataFrame({'A': [1, 2], 'B': [3, 4]}), | ||
'second': cudf.DataFrame({'A': [5, 6], 'B': [7, 8]}), | ||
} | ||
Comment on lines
+1928
to
+1931
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we parametrize to include a few additional test cases?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aren't single entry in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry - I mistyped! I've edited my comment |
||
|
||
# horizontal concat | ||
result1 = cudf.concat(d, axis=1) | ||
expected1 = cudf.DataFrame({ | ||
('first', 'A'): [1, 2], | ||
('first', 'B'): [3, 4], | ||
('second', 'A'): [5, 6], | ||
('second', 'B'): [7, 8] | ||
}) | ||
assert_eq(expected1, result1) |
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.
Should we also add tests for concatenating dict-of-Series and dict-of-Index objects?
If those cases don't work currently - that's OK. We should at least raise a
NotImplementedError
.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.
I can add tests for these.