Skip to content

Commit 8d8d7a3

Browse files
author
Tom Augspurger
committed
check in interp_with_fill too
1 parent 9f38612 commit 8d8d7a3

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

doc/source/release.rst

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,16 +116,13 @@ Bug Fixes
116116
- TimeGrouper has a more compatible API to the rest of the groupers (e.g. ``groups`` was missing) (:issue:`3881`)
117117
- Bug in ``pd.eval`` when parsing strings with possible tokens like ``'&'``
118118
(:issue:`6351`)
119-
<<<<<<< HEAD
120119
- Bug correctly handle placements of ``-inf`` in Panels when dividing by integer 0 (:issue:`6178`)
121120
- ``DataFrame.shift`` with ``axis=1`` was raising (:issue:`6371`)
122121
- Disabled clipboard tests until release time (run locally with ``nosetests -A disabled`` (:issue:`6048`).
123122
- Bug in ``DataFrame.replace()`` when passing a nested ``dict`` that contained
124123
keys not in the values to be replaced (:issue:`6342`)
125124
- Bug in take with duplicate columns not consolidated (:issue:`6240`)
126-
=======
127125
- Bug in interpolate changing dtypes (:issue:`6290`)
128-
>>>>>>> 336b309... BUG: preserve dtypes in interpolate
129126

130127
pandas 0.13.1
131128
-------------

pandas/core/internals.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -805,13 +805,25 @@ def interpolate(self, method='pad', axis=0, index=None,
805805
values=None, inplace=False, limit=None,
806806
fill_value=None, coerce=False, downcast=None, **kwargs):
807807

808+
def check_int_bool(self, inplace):
809+
# Only FloatBlocks will contain NaNs.
810+
# timedelta subclasses IntBlock
811+
if (self.is_bool or self.is_integer) and not self.is_timedelta:
812+
if inplace:
813+
return self
814+
else:
815+
return self.copy()
816+
808817
# a fill na type method
809818
try:
810819
m = com._clean_fill_method(method)
811820
except:
812821
m = None
813822

814823
if m is not None:
824+
r = check_int_bool(self, inplace)
825+
if r is not None:
826+
return r
815827
return self._interpolate_with_fill(method=m,
816828
axis=axis,
817829
inplace=inplace,
@@ -826,6 +838,9 @@ def interpolate(self, method='pad', axis=0, index=None,
826838
m = None
827839

828840
if m is not None:
841+
r = check_int_bool(self, inplace)
842+
if r is not None:
843+
return r
829844
return self._interpolate(method=m,
830845
index=index,
831846
values=values,

0 commit comments

Comments
 (0)