Skip to content

Commit 481e1fc

Browse files
ntachukwunoatamir
authored andcommitted
TST: dt.total_seconds() stores float with appending 0.00000000000001 fix (pandas-dev#48218)
* TST GH34290 Test for dt.total_seconds() stores float with appending 0.00000000000001 fix * simpler test * use Timedelta instead of pd.Timedelta
1 parent dda069d commit 481e1fc

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/tests/arrays/test_timedeltas.py

+7
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ def test_total_seconds(self, unit, tda):
6767
expected = tda_nano.total_seconds()
6868
tm.assert_numpy_array_equal(result, expected)
6969

70+
def test_timedelta_array_total_seconds(self):
71+
# GH34290
72+
expected = Timedelta("2 min").total_seconds()
73+
74+
result = pd.array([Timedelta("2 min")]).total_seconds()[0]
75+
assert result == expected
76+
7077
@pytest.mark.parametrize(
7178
"nat", [np.datetime64("NaT", "ns"), np.datetime64("NaT", "us")]
7279
)

0 commit comments

Comments
 (0)