Skip to content

Commit 50d9718

Browse files
committed
add check about numpy version...
1 parent 41bcd82 commit 50d9718

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

pandas/core/series.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222

2323
__all__ = ['Series', 'TimeSeries']
2424

25+
def _numpy_lt_151():
26+
return np.__version__ < '1.5.1'
27+
2528
#-------------------------------------------------------------------------------
2629
# Wrapper function for Series arithmetic methods
2730

@@ -1063,7 +1066,10 @@ def fillna(self, value=None, method='pad'):
10631066
if method == 'bfill':
10641067
method = 'backfill'
10651068

1066-
mask = isnull(self.values).astype(np.uint8)
1069+
mask = isnull(self.values)
1070+
1071+
if _numpy_lt_151(): # pragma: no cover
1072+
mask = mask.astype(np.uint8)
10671073

10681074
if method == 'pad':
10691075
indexer = _tseries.get_pad_indexer(mask)

0 commit comments

Comments
 (0)