@@ -148,7 +148,7 @@ cdef inline bint _is_fixed_offset(object tz):
148
148
else :
149
149
return 0
150
150
return 1
151
-
151
+
152
152
153
153
_zero_time = datetime_time(0 , 0 )
154
154
@@ -340,7 +340,7 @@ class Timestamp(_Timestamp):
340
340
@property
341
341
def is_year_end (self ):
342
342
return self ._get_start_end_field(' is_year_end' )
343
-
343
+
344
344
def tz_localize (self , tz ):
345
345
"""
346
346
Convert naive Timestamp to local time zone
@@ -994,7 +994,7 @@ cdef inline void _localize_tso(_TSObject obj, object tz):
994
994
pandas_datetime_to_datetimestruct(obj.value + deltas[0 ],
995
995
PANDAS_FR_ns, & obj.dts)
996
996
else :
997
- pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, & obj.dts)
997
+ pandas_datetime_to_datetimestruct(obj.value, PANDAS_FR_ns, & obj.dts)
998
998
obj.tzinfo = tz
999
999
elif _treat_tz_as_pytz(tz):
1000
1000
inf = tz._transition_info[pos]
@@ -1044,7 +1044,7 @@ cdef inline object _get_zone(object tz):
1044
1044
cpdef inline object maybe_get_tz(object tz):
1045
1045
'''
1046
1046
(Maybe) Construct a timezone object from a string. If tz is a string, use it to construct a timezone object.
1047
- Otherwise, just return tz.
1047
+ Otherwise, just return tz.
1048
1048
'''
1049
1049
if isinstance (tz, string_types):
1050
1050
if tz.startswith(' dateutil/' ):
@@ -1337,7 +1337,7 @@ def array_to_timedelta64(ndarray[object] values, coerce=False):
1337
1337
def convert_to_timedelta (object ts , object unit = ' ns' , coerce = False ):
1338
1338
return convert_to_timedelta64(ts, unit, coerce )
1339
1339
1340
- cdef convert_to_timedelta64(object ts, object unit, object coerce ):
1340
+ cdef inline convert_to_timedelta64(object ts, object unit, object coerce ):
1341
1341
"""
1342
1342
Convert an incoming object to a timedelta64 if possible
1343
1343
@@ -1952,9 +1952,9 @@ cdef inline bint _treat_tz_as_dateutil(object tz):
1952
1952
cdef inline object _tz_cache_key(object tz):
1953
1953
"""
1954
1954
Return the key in the cache for the timezone info object or None if unknown.
1955
-
1955
+
1956
1956
The key is currently the tz string for pytz timezones, the filename for dateutil timezones.
1957
-
1957
+
1958
1958
Notes
1959
1959
=====
1960
1960
This cannot just be the hash of a timezone object. Unfortunately, the hashes of two dateutil tz objects
@@ -2136,7 +2136,7 @@ def tz_localize_to_utc(ndarray[int64_t] vals, object tz, bint infer_dst=False):
2136
2136
# right side
2137
2137
idx_shifted = _ensure_int64(
2138
2138
np.maximum(0 , trans.searchsorted(vals + DAY_NS, side = ' right' ) - 1 ))
2139
-
2139
+
2140
2140
for i in range (n):
2141
2141
v = vals[i] - deltas[idx_shifted[i]]
2142
2142
pos = bisect_right_i8(tdata, v, ntrans) - 1
@@ -2516,7 +2516,7 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
2516
2516
2517
2517
pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, & dts)
2518
2518
dom = dts.day
2519
-
2519
+
2520
2520
if dom == 1 :
2521
2521
out[i] = 1
2522
2522
return out.view(bool )
@@ -2534,7 +2534,7 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
2534
2534
doy = mo_off + dom
2535
2535
ldom = _month_offset[isleap, dts.month]
2536
2536
dow = ts_dayofweek(ts)
2537
-
2537
+
2538
2538
if (ldom == doy and dow < 5 ) or (dow == 4 and (ldom - doy <= 2 )):
2539
2539
out[i] = 1
2540
2540
return out.view(bool )
@@ -2548,9 +2548,9 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
2548
2548
dom = dts.day
2549
2549
doy = mo_off + dom
2550
2550
ldom = _month_offset[isleap, dts.month]
2551
-
2551
+
2552
2552
if ldom == doy:
2553
- out[i] = 1
2553
+ out[i] = 1
2554
2554
return out.view(bool )
2555
2555
2556
2556
elif field == ' is_quarter_start' :
@@ -2564,17 +2564,17 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
2564
2564
dow = ts_dayofweek(ts)
2565
2565
2566
2566
if ((dts.month - start_month) % 3 == 0 ) and ((dom == 1 and dow < 5 ) or (dom <= 3 and dow == 0 )):
2567
- out[i] = 1
2567
+ out[i] = 1
2568
2568
return out.view(bool )
2569
2569
else :
2570
2570
for i in range (count):
2571
2571
if dtindex[i] == NPY_NAT: out[i] = - 1 ; continue
2572
2572
2573
2573
pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, & dts)
2574
2574
dom = dts.day
2575
-
2575
+
2576
2576
if ((dts.month - start_month) % 3 == 0 ) and dom == 1 :
2577
- out[i] = 1
2577
+ out[i] = 1
2578
2578
return out.view(bool )
2579
2579
2580
2580
elif field == ' is_quarter_end' :
@@ -2590,9 +2590,9 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
2590
2590
doy = mo_off + dom
2591
2591
ldom = _month_offset[isleap, dts.month]
2592
2592
dow = ts_dayofweek(ts)
2593
-
2593
+
2594
2594
if ((dts.month - end_month) % 3 == 0 ) and ((ldom == doy and dow < 5 ) or (dow == 4 and (ldom - doy <= 2 ))):
2595
- out[i] = 1
2595
+ out[i] = 1
2596
2596
return out.view(bool )
2597
2597
else :
2598
2598
for i in range (count):
@@ -2604,9 +2604,9 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
2604
2604
dom = dts.day
2605
2605
doy = mo_off + dom
2606
2606
ldom = _month_offset[isleap, dts.month]
2607
-
2607
+
2608
2608
if ((dts.month - end_month) % 3 == 0 ) and (ldom == doy):
2609
- out[i] = 1
2609
+ out[i] = 1
2610
2610
return out.view(bool )
2611
2611
2612
2612
elif field == ' is_year_start' :
@@ -2620,7 +2620,7 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
2620
2620
dow = ts_dayofweek(ts)
2621
2621
2622
2622
if (dts.month == start_month) and ((dom == 1 and dow < 5 ) or (dom <= 3 and dow == 0 )):
2623
- out[i] = 1
2623
+ out[i] = 1
2624
2624
return out.view(bool )
2625
2625
else :
2626
2626
for i in range (count):
@@ -2648,7 +2648,7 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
2648
2648
ldom = _month_offset[isleap, dts.month]
2649
2649
2650
2650
if (dts.month == end_month) and ((ldom == doy and dow < 5 ) or (dow == 4 and (ldom - doy <= 2 ))):
2651
- out[i] = 1
2651
+ out[i] = 1
2652
2652
return out.view(bool )
2653
2653
else :
2654
2654
for i in range (count):
@@ -2665,7 +2665,7 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
2665
2665
if (dts.month == end_month) and (ldom == doy):
2666
2666
out[i] = 1
2667
2667
return out.view(bool )
2668
-
2668
+
2669
2669
raise ValueError (" Field %s not supported" % field)
2670
2670
2671
2671
0 commit comments