Skip to content

Commit f169b68

Browse files
committed
Initial test case
1 parent 98c9c7f commit f169b68

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
@@ -2192,3 +2192,19 @@ def test_mixed_col_index_dtype(string_dtype_no_object):
21922192
expected.columns = expected.columns.astype(string_dtype_no_object)
21932193

21942194
tm.assert_frame_equal(result, expected)
2195+
2196+
2197+
def test_df_mul_series_fill_value():
2198+
# GH 61581
2199+
data = np.arange(50).reshape(10, 5)
2200+
columns = list("ABCDE")
2201+
df = DataFrame(data, columns=columns)
2202+
for i in range(5):
2203+
df.iat[i, i] = np.nan
2204+
df.iat[i + 1, i] = np.nan
2205+
df.iat[i + 4, i] = np.nan
2206+
2207+
df_result = df[["A", "B", "C", "D"]].mul(df["E"], axis=0, fill_value=5)
2208+
df_expected = df[["A", "B", "C", "D"]].mul(df["E"].fillna(5), axis=0)
2209+
2210+
tm.assert_frame_equal(df_result, df_expected)

0 commit comments

Comments
 (0)