Skip to content

Commit 95722ff

Browse files
committed
code review changes
1 parent 18b756c commit 95722ff

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

pandas/core/missing.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def _interp_limit(invalid, fw_limit, bw_limit):
188188
if method in ('values', 'index'):
189189
inds = np.asarray(xvalues)
190190
# hack for DatetimeIndex, #1646
191-
if (needs_i8_conversion(inds.dtype.type)):
191+
if needs_i8_conversion(inds.dtype.type):
192192
inds = inds.view(np.int64)
193193
if inds.dtype == np.object_:
194194
inds = lib.maybe_convert_objects(inds)

pandas/tests/series/test_missing.py

+8-1
Original file line numberDiff line numberDiff line change
@@ -893,14 +893,21 @@ def test_spline_error(self):
893893

894894
def test_interp_timedelta64(self):
895895
# GH 6424
896-
tm._skip_if_no_scipy()
897896
df = Series([1, np.nan, 3],
898897
index=pd.to_timedelta([1, 2, 3]))
899898
result = df.interpolate(method='time')
900899
expected = Series([1., 2., 3.],
901900
index=pd.to_timedelta([1, 2, 3]))
902901
assert_series_equal(result, expected)
903902

903+
# test for non uniform spacing
904+
df = Series([1, np.nan, 3],
905+
index=pd.to_timedelta([1, 2, 4]))
906+
result = df.interpolate(method='time')
907+
expected = Series([1., 1.666667, 3.],
908+
index=pd.to_timedelta([1, 2, 4]))
909+
assert_series_equal(result, expected)
910+
904911

905912
if __name__ == '__main__':
906913
import nose

0 commit comments

Comments
 (0)