Skip to content

Commit c74e1db

Browse files
committed
Add new test
1 parent e8dac0d commit c74e1db

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

pandas/tests/frame/test_analytics.py

+17
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,23 @@ def test_any_all_extra(self):
13941394
# df.any(1, bool_only=True)
13951395
# df.all(1, bool_only=True)
13961396

1397+
def test_any_datetime(self):
1398+
1399+
# GH 23070
1400+
float_data = [1, np.nan, 3, np.nan]
1401+
datetime_data = [pd.Timestamp('1960-02-15'),
1402+
pd.Timestamp('1960-02-16'),
1403+
pd.NaT,
1404+
pd.NaT]
1405+
df = DataFrame({
1406+
"A": float_data,
1407+
"B": datetime_data
1408+
})
1409+
1410+
result = df.any(1)
1411+
expected = Series([True, True, True, False])
1412+
tm.assert_series_equal(result, expected)
1413+
13971414
@pytest.mark.parametrize('func, data, expected', [
13981415
(np.any, {}, False),
13991416
(np.all, {}, True),

0 commit comments

Comments
 (0)