Skip to content

Commit 1761dbc

Browse files
jbrockmendelaeltanawy
authored andcommitted
TST: Test for bug fixed during pandas-dev#22534 discussion (pandas-dev#22694)
1 parent fab723c commit 1761dbc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pandas/tests/frame/test_arithmetic.py

+12
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,18 @@ def test_df_flex_cmp_constant_return_types_empty(self, opname):
100100
# Arithmetic
101101

102102
class TestFrameFlexArithmetic(object):
103+
def test_df_add_td64_columnwise(self):
104+
# GH#22534 Check that column-wise addition broadcasts correctly
105+
dti = pd.date_range('2016-01-01', periods=10)
106+
tdi = pd.timedelta_range('1', periods=10)
107+
tser = pd.Series(tdi)
108+
df = pd.DataFrame({0: dti, 1: tdi})
109+
110+
result = df.add(tser, axis=0)
111+
expected = pd.DataFrame({0: dti + tdi,
112+
1: tdi + tdi})
113+
tm.assert_frame_equal(result, expected)
114+
103115
def test_df_add_flex_filled_mixed_dtypes(self):
104116
# GH#19611
105117
dti = pd.date_range('2016-01-01', periods=3)

0 commit comments

Comments
 (0)