10000 BUG: preserve EA dtype in transpose by TomAugspurger · Pull Request #30091 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

BUG: preserve EA dtype in transpose #30091

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

Merged
merged 20 commits into from
Dec 27, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
simplify
  • Loading branch information
TomAugspurger committed Dec 6, 2019
commit bfdfccf2304255c95c7d8169ba18ae2d026c444b
1 change: 1 addition & 0 deletions pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2595,6 +2595,7 @@ def transpose(self, *args, copy=False, **kwargs):
1 object
dtype: object
"""
nv.validate_transpose(args, dict())
if args == () or args == (None,):
args = (1, 0)
else:
Expand Down
2 changes: 2 additions & 0 deletions pandas/tests/extension/base/reshaping.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,3 +309,5 @@ def test_transpose(self, data):
index=["A", "B"],
)
self.assert_frame_equal(result, expected)

self.assert_frame_equal(np.transpose(np.transpose(expected)), expected)
4 changes: 4 additions & 0 deletions pandas/tests/extension/json/test_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ def test_unstack(self, data, index):
# this matches otherwise
return super().test_unstack(data, index)

@pytest.mark.skip(reason="Inconsistent sizes.")
def test_transpose(self, data):
super().test_transpose(data)


class TestGetitem(BaseJSON, base.BaseGetitemTests):
pass
Expand Down
0