Skip to content

TST: add test for mixed dtypes of df col index #47382 #55720

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 3 commits into from
Oct 30, 2023
Merged
Changes from all commits
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
10 changes: 10 additions & 0 deletions pandas/tests/frame/test_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -2132,3 +2132,13 @@ def test_enum_column_equality():
expected = Series([True, True, True], name=Cols.col1)

tm.assert_series_equal(result, expected)


def test_mixed_col_index_dtype():
# GH 47382
df1 = DataFrame(columns=list("abc"), data=1.0, index=[0])
df2 = DataFrame(columns=list("abc"), data=0.0, index=[0])
df1.columns = df2.columns.astype("string")
result = df1 + df2
expected = DataFrame(columns=list("abc"), data=1.0, index=[0])
tm.assert_frame_equal(result, expected)