@@ -76,7 +76,8 @@ cdef inline object create_time_from_ts(
76
76
77
77
@ cython.wraparound (False )
78
78
@ cython.boundscheck (False )
79
- def ints_to_pydatetime (int64_t[:] arr , tz = None , freq = None , box = " datetime" ):
79
+ def ints_to_pydatetime (int64_t[:] arr , object tz = None , object freq = None ,
80
+ str box = " datetime" ):
80
81
"""
81
82
Convert an i8 repr to an ndarray of datetimes, date, time or Timestamp
82
83
@@ -104,8 +105,9 @@ def ints_to_pydatetime(int64_t[:] arr, tz=None, freq=None, box="datetime"):
104
105
int64_t[:] deltas
105
106
Py_ssize_t pos
106
107
npy_datetimestruct dts
107
- object dt
108
- int64_t value, delta
108
+ object dt, new_tz
109
+ str typ
110
+ int64_t value, delta, local_value
109
111
ndarray[object ] result = np.empty(n, dtype = object )
110
112
object (* func_create)(int64_t, npy_datetimestruct, object , object )
111
113
@@ -303,7 +305,8 @@ def format_array_from_datetime(ndarray[int64_t] values, object tz=None,
303
305
return result
304
306
305
307
306
- def array_with_unit_to_datetime (ndarray values , unit , errors = ' coerce' ):
308
+ def array_with_unit_to_datetime (ndarray values , object unit ,
309
+ str errors = ' coerce' ):
307
310
"""
308
311
convert the ndarray according to the unit
309
312
if errors:
@@ -458,10 +461,10 @@ def array_with_unit_to_datetime(ndarray values, unit, errors='coerce'):
458
461
459
462
@ cython.wraparound (False )
460
463
@ cython.boundscheck (False )
461
- cpdef array_to_datetime(ndarray[object ] values, errors = ' raise' ,
462
- dayfirst = False , yearfirst = False ,
463
- format = None , utc = None ,
464
- require_iso8601 = False ):
464
+ cpdef array_to_datetime(ndarray[object ] values, str errors = ' raise' ,
465
+ bint dayfirst = False , bint yearfirst = False ,
466
+ object format = None , object utc = None ,
467
+ bint require_iso8601 = False ):
465
468
"""
466
469
Converts a 1D array of date-like values to a numpy array of either:
467
470
1) datetime64[ns] data
@@ -510,9 +513,11 @@ cpdef array_to_datetime(ndarray[object] values, errors='raise',
510
513
bint is_raise = errors== ' raise'
511
514
bint is_ignore = errors== ' ignore'
512
515
bint is_coerce = errors== ' coerce'
516
+ bint is_same_offsets
513
517
_TSObject _ts
518
+ int64_t value
514
519
int out_local= 0 , out_tzoffset= 0
515
- float offset_seconds
520
+ float offset_seconds, tz_offset
516
521
set out_tzoffset_vals = set ()
517
522
518
523
# specify error conditions
@@ -764,7 +769,7 @@ cpdef array_to_datetime(ndarray[object] values, errors='raise',
764
769
@ cython.wraparound (False )
765
770
@ cython.boundscheck (False )
766
771
cdef array_to_datetime_object(ndarray[object ] values, bint is_raise,
767
- dayfirst = False , yearfirst = False ):
772
+ bint dayfirst = False , bint yearfirst = False ):
768
773
"""
769
774
Fall back function for array_to_datetime
770
775
0 commit comments