Skip to content

Commit 4e0465d

Browse files
author
y-p
committed
Merge pull request #3098 from cpcloud/time-import-fix
BLD: fix time module import conflict
2 parents 1f138a4 + 4c4dc33 commit 4e0465d

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

pandas/tslib.pyx

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@ from numpy cimport (int32_t, int64_t, import_array, ndarray,
55
NPY_INT64, NPY_DATETIME, NPY_TIMEDELTA)
66
import numpy as np
77

8-
from cpython cimport *
8+
from cpython cimport (
9+
PyTypeObject,
10+
PyFloat_Check,
11+
PyObject_RichCompareBool,
12+
PyString_Check
13+
)
914

1015
# Cython < 0.17 doesn't have this in cpython
1116
cdef extern from "Python.h":
@@ -909,12 +914,12 @@ def array_to_timedelta64(ndarray[object] values, coerce=True):
909914
val = _delta_to_nanoseconds(np.timedelta64(val).item())
910915

911916
result[i] = val
912-
917+
913918
elif util._checknull(val) or val == iNaT or val is NaT:
914919
result[i] = iNaT
915920

916921
else:
917-
922+
918923
# just return, don't convert
919924
if not coerce:
920925
return values.copy()
@@ -925,7 +930,7 @@ def array_to_timedelta64(ndarray[object] values, coerce=True):
925930

926931
def repr_timedelta64(object value):
927932
""" provide repr for timedelta64 """
928-
933+
929934
ivalue = value.view('i8')
930935

931936
# put frac in seconds
@@ -1009,9 +1014,9 @@ def array_strptime(ndarray[object] values, object fmt):
10091014

10101015
result = np.empty(n, dtype='M8[ns]')
10111016
iresult = result.view('i8')
1012-
1017+
10131018
dts.us = dts.ps = dts.as = 0
1014-
1019+
10151020
cdef dict _parse_code_table = {
10161021
'y': 0,
10171022
'Y': 1,

0 commit comments

Comments
 (0)