Skip to content

Commit 3f9c7fd

Browse files
author
Carlos Souza
committed
Minor comments
1 parent 70c958f commit 3f9c7fd

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

pandas/core/generic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3972,7 +3972,7 @@ def asof(self, where, subset=None):
39723972
where = Index(where) if is_list else Index([where])
39733973

39743974
nulls = self.isnull() if is_series else self[subset].isnull().any(1)
3975-
if nulls.all():
3975+
if nulls.values.all():
39763976
if is_series:
39773977
return pd.Series(np.nan, index=where)
39783978
else:

pandas/tests/frame/test_asof.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ def test_missing(self):
8282
tm.assert_frame_equal(result, expected)
8383

8484
def test_all_nans(self):
85-
# series is all nans
85+
# GH 15713
86+
# DataFrame is all nans
8687
result = DataFrame([np.nan]).asof([0])
8788
expected = DataFrame([np.nan])
8889
tm.assert_frame_equal(result, expected)

pandas/tests/series/test_asof.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ def test_errors(self):
150150
s.asof(s.index[0], subset='foo')
151151

152152
def test_all_nans(self):
153+
# GH 15713
153154
# series is all nans
154155
result = Series([np.nan]).asof([0])
155156
expected = Series([np.nan])
@@ -167,4 +168,4 @@ def test_all_nans(self):
167168
# testing scalar input
168169
date = date_range('1/1/1990', periods=N * 3, freq='25s')[0]
169170
result = Series(np.nan, index=rng).asof(date)
170-
self.assertTrue(result != result)
171+
assert isnull(result)

0 commit comments

Comments
 (0)