Skip to content

Commit 4e26ab8

Browse files
author
Carlos Souza
committed
BUG pandas-dev#15713 Series.asof return nan when series is all nans.
1 parent c78d687 commit 4e26ab8

File tree

3 files changed

+1
-4
lines changed

3 files changed

+1
-4
lines changed

RELEASE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Release Notes
22
=============
33

4-
The list of changes to Pandas between each release can be found
4+
The list of changes to pandas between each release can be found
55
[here](http://pandas.pydata.org/pandas-docs/stable/whatsnew.html). For full
66
details, see the commit logs at http://github.com/pandas-dev/pandas.

pandas/indexes/base.py

-1
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,6 @@ def asof_locs(self, where, mask):
18901890
locs = self.values[mask].searchsorted(where.values, side='right')
18911891

18921892
locs = np.where(locs > 0, locs - 1, 0)
1893-
18941893
result = np.arange(len(self))[mask].take(locs)
18951894

18961895
first = mask.argmax()

pandas/tests/series/test_asof.py

-2
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,6 @@ def test_errors(self):
153153

154154
# series is all nans
155155
result = Series([np.nan]).asof([0])
156-
157156
expected = Series([np.nan])
158-
159157
assert_series_equal(result, expected)
160158

0 commit comments

Comments
 (0)