-
-
Notifications
You must be signed in to change notification settings - Fork 19.4k
Bugfix for multilevel columns with empty strings in Python 2 #17099
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
Changes from 2 commits
e54c734
a798b70
63071bd
e7c9f97
b419cb6
f1edf68
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 |
|---|---|---|
|
|
@@ -1694,6 +1694,28 @@ def test_mixed_depth_get(self): | |
| tm.assert_series_equal(result, expected, check_names=False) | ||
| assert result.name == ('routine1', 'result1') | ||
|
Contributor
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 you parametrize |
||
|
|
||
| def test_mixed_depth_get_unicode_placeholders_py2(self): | ||
| # Note this is only different to test_mixed_depth_get() on Python 2 | ||
|
||
| arrays = [[u('a'), u('top'), u('top'), | ||
| u('routine1'), u('routine1'), u('routine2')], | ||
| [u(''), u('OD'), u('OD'), | ||
| u('result1'), u('result2'), u('result1')], | ||
| [u(''), u('wx'), u('wy'), u(''), u(''), u('')]] | ||
|
|
||
| tuples = sorted(zip(*arrays)) | ||
| index = MultiIndex.from_tuples(tuples) | ||
| df = DataFrame(randn(4, 6), columns=index) | ||
|
||
|
|
||
| result = df['a'] | ||
| expected = df['a', '', ''] | ||
| tm.assert_series_equal(result, expected, check_names=False) | ||
|
||
| assert result.name == 'a' | ||
|
|
||
| result = df['routine1', 'result1'] | ||
| expected = df['routine1', 'result1', ''] | ||
| tm.assert_series_equal(result, expected, check_names=False) | ||
|
||
| assert result.name == ('routine1', 'result1') | ||
|
|
||
| def test_mixed_depth_insert(self): | ||
| arrays = [['a', 'top', 'top', 'routine1', 'routine1', 'routine2'], | ||
| ['', 'OD', 'OD', 'result1', 'result2', '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.
put a comment what is going on here.