Skip to content

Commit f7c8fc8

Browse files
TST: GH26650, added new test to validate numpy matmul function with dataframes (#47427)
* TST: GH26650, added new test to validate numpy matmul function with dataframes as inputs * TST: GH26650, updated variable names * Updated based on PR feedback * Removed variable initialisations per feedback * Final updates to PR * Update pandas/tests/series/test_ufunc.py Co-authored-by: Matthew Roeschke <[email protected]>
1 parent 01b8cd2 commit f7c8fc8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pandas/tests/series/test_ufunc.py

+11
Original file line numberDiff line numberDiff line change
@@ -439,3 +439,14 @@ def test_outer():
439439

440440
with pytest.raises(NotImplementedError, match=tm.EMPTY_STRING_PATTERN):
441441
np.subtract.outer(s, o)
442+
443+
444+
def test_np_matmul():
445+
# GH26650
446+
df1 = pd.DataFrame(data=[[-1, 1, 10]])
447+
df2 = pd.DataFrame(data=[-1, 1, 10])
448+
expected_result = pd.DataFrame(data=[102])
449+
tm.assert_frame_equal(
450+
expected_result,
451+
np.matmul(df1, df2),
452+
)

0 commit comments

Comments
 (0)