Skip to content

BUG: iloc.__setitem__ with duplicate columns #32477

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 17 commits into from
Mar 11, 2020
Merged
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
fix test on 32bit platform
  • Loading branch information
jbrockmendel committed Mar 6, 2020
commit 540d3eab42a193e71db6ce0a9862beb0ea5112da
4 changes: 3 additions & 1 deletion pandas/tests/indexing/test_iloc.py
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,8 @@ def test_iloc_setitem_list_duplicate_columns(self):
tm.assert_frame_equal(df, expected)

def test_iloc_setitem_series_duplicate_columns(self):
df = pd.DataFrame(np.arange(8).reshape(2, 4), columns=["A", "B", "A", "B"])
df = pd.DataFrame(
np.arange(8, dtype=np.int64).reshape(2, 4), columns=["A", "B", "A", "B"]
)
df.iloc[:, 0] = df.iloc[:, 0].astype(np.float64)
assert df.dtypes.iloc[2] == np.int64