Skip to content

Commit a9c8d85

Browse files
committed
Initial test case
1 parent d5f97ed commit a9c8d85

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

pandas/tests/frame/test_arithmetic.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2199,3 +2199,19 @@ def test_mixed_col_index_dtype(using_infer_string):
21992199
dtype = "string"
22002200
expected.columns = expected.columns.astype(dtype)
22012201
tm.assert_frame_equal(result, expected)
2202+
2203+
2204+
def test_df_mul_series_fill_value():
2205+
# GH 61581
2206+
data = np.arange(50).reshape(10, 5)
2207+
columns = list("ABCDE")
2208+
df = DataFrame(data, columns=columns)
2209+
for i in range(5):
2210+
df.iat[i, i] = np.nan
2211+
df.iat[i + 1, i] = np.nan
2212+
df.iat[i + 4, i] = np.nan
2213+
2214+
df_result = df[["A", "B", "C", "D"]].mul(df["E"], axis=0, fill_value=5)
2215+
df_expected = df[["A", "B", "C", "D"]].mul(df["E"].fillna(5), axis=0)
2216+
2217+
tm.assert_frame_equal(df_result, df_expected)

0 commit comments

Comments
 (0)