Skip to content

Commit 18b756c

Browse files
committed
checking if index is of time type using needs_i8_conversion
1 parent 81dab58 commit 18b756c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pandas/core/missing.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
is_float_dtype, is_datetime64_dtype,
1313
is_integer_dtype, _ensure_float64,
1414
is_scalar,
15-
_DATELIKE_DTYPES)
15+
_DATELIKE_DTYPES,
16+
needs_i8_conversion)
1617
from pandas.types.missing import isnull
1718

1819

@@ -187,8 +188,7 @@ def _interp_limit(invalid, fw_limit, bw_limit):
187188
if method in ('values', 'index'):
188189
inds = np.asarray(xvalues)
189190
# hack for DatetimeIndex, #1646
190-
if (issubclass(inds.dtype.type, np.datetime64) or
191-
issubclass(inds.dtype.type, np.timedelta64)):
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)

0 commit comments

Comments
 (0)