Skip to content

TST: additional regression cases for slicing blockwise op (GH34421) #34434

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 1 commit into from
May 28, 2020
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
15 changes: 12 additions & 3 deletions pandas/tests/frame/test_arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,16 @@ def test_dataframe_blockwise_slicelike():
df2 = df1.copy()
df2.iloc[0, [1, 3, 7]] = np.nan

res = df1 + df2
df3 = df1.copy()
df3.iloc[0, [5]] = np.nan

expected = pd.DataFrame({i: df1[i] + df2[i] for i in df1.columns})
tm.assert_frame_equal(res, expected)
df4 = df1.copy()
df4.iloc[0, np.arange(2, 5)] = np.nan
df5 = df1.copy()
df5.iloc[0, np.arange(4, 7)] = np.nan

for left, right in [(df1, df2), (df2, df3), (df4, df5)]:
res = left + right

expected = pd.DataFrame({i: left[i] + right[i] for i in left.columns})
tm.assert_frame_equal(res, expected)