@@ -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
split_tz = tz.split(' /' , 1 )
@@ -1338,7 +1338,7 @@ def array_to_timedelta64(ndarray[object] values, coerce=False):
1338
1338
def convert_to_timedelta (object ts , object unit = ' ns' , coerce = False ):
1339
1339
return convert_to_timedelta64(ts, unit, coerce )
1340
1340
1341
- cdef convert_to_timedelta64(object ts, object unit, object coerce ):
1341
+ cdef inline convert_to_timedelta64(object ts, object unit, object coerce ):
1342
1342
"""
1343
1343
Convert an incoming object to a timedelta64 if possible
1344
1344
@@ -1953,9 +1953,9 @@ cdef inline bint _treat_tz_as_dateutil(object tz):
1953
1953
cdef inline object _tz_cache_key(object tz):
1954
1954
"""
1955
1955
Return the key in the cache for the timezone info object or None if unknown.
1956
-
1956
+
1957
1957
The key is currently the tz string for pytz timezones, the filename for dateutil timezones.
1958
-
1958
+
1959
1959
Notes
1960
1960
=====
1961
1961
This cannot just be the hash of a timezone object. Unfortunately, the hashes of two dateutil tz objects
@@ -2137,7 +2137,7 @@ def tz_localize_to_utc(ndarray[int64_t] vals, object tz, bint infer_dst=False):
2137
2137
# right side
2138
2138
idx_shifted = _ensure_int64(
2139
2139
np.maximum(0 , trans.searchsorted(vals + DAY_NS, side = ' right' ) - 1 ))
2140
-
2140
+
2141
2141
for i in range (n):
2142
2142
v = vals[i] - deltas[idx_shifted[i]]
2143
2143
pos = bisect_right_i8(tdata, v, ntrans) - 1
@@ -2517,7 +2517,7 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
2517
2517
2518
2518
pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, & dts)
2519
2519
dom = dts.day
2520
-
2520
+
2521
2521
if dom == 1 :
2522
2522
out[i] = 1
2523
2523
return out.view(bool )
@@ -2535,7 +2535,7 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
2535
2535
doy = mo_off + dom
2536
2536
ldom = _month_offset[isleap, dts.month]
2537
2537
dow = ts_dayofweek(ts)
2538
-
2538
+
2539
2539
if (ldom == doy and dow < 5 ) or (dow == 4 and (ldom - doy <= 2 )):
2540
2540
out[i] = 1
2541
2541
return out.view(bool )
@@ -2549,9 +2549,9 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
2549
2549
dom = dts.day
2550
2550
doy = mo_off + dom
2551
2551
ldom = _month_offset[isleap, dts.month]
2552
-
2552
+
2553
2553
if ldom == doy:
2554
- out[i] = 1
2554
+ out[i] = 1
2555
2555
return out.view(bool )
2556
2556
2557
2557
elif field == ' is_quarter_start' :
@@ -2565,17 +2565,17 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
2565
2565
dow = ts_dayofweek(ts)
2566
2566
2567
2567
if ((dts.month - start_month) % 3 == 0 ) and ((dom == 1 and dow < 5 ) or (dom <= 3 and dow == 0 )):
2568
- out[i] = 1
2568
+ out[i] = 1
2569
2569
return out.view(bool )
2570
2570
else :
2571
2571
for i in range (count):
2572
2572
if dtindex[i] == NPY_NAT: out[i] = - 1 ; continue
2573
2573
2574
2574
pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, & dts)
2575
2575
dom = dts.day
2576
-
2576
+
2577
2577
if ((dts.month - start_month) % 3 == 0 ) and dom == 1 :
2578
- out[i] = 1
2578
+ out[i] = 1
2579
2579
return out.view(bool )
2580
2580
2581
2581
elif field == ' is_quarter_end' :
@@ -2591,9 +2591,9 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
2591
2591
doy = mo_off + dom
2592
2592
ldom = _month_offset[isleap, dts.month]
2593
2593
dow = ts_dayofweek(ts)
2594
-
2594
+
2595
2595
if ((dts.month - end_month) % 3 == 0 ) and ((ldom == doy and dow < 5 ) or (dow == 4 and (ldom - doy <= 2 ))):
2596
- out[i] = 1
2596
+ out[i] = 1
2597
2597
return out.view(bool )
2598
2598
else :
2599
2599
for i in range (count):
@@ -2605,9 +2605,9 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
2605
2605
dom = dts.day
2606
2606
doy = mo_off + dom
2607
2607
ldom = _month_offset[isleap, dts.month]
2608
-
2608
+
2609
2609
if ((dts.month - end_month) % 3 == 0 ) and (ldom == doy):
2610
- out[i] = 1
2610
+ out[i] = 1
2611
2611
return out.view(bool )
2612
2612
2613
2613
elif field == ' is_year_start' :
@@ -2621,7 +2621,7 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
2621
2621
dow = ts_dayofweek(ts)
2622
2622
2623
2623
if (dts.month == start_month) and ((dom == 1 and dow < 5 ) or (dom <= 3 and dow == 0 )):
2624
- out[i] = 1
2624
+ out[i] = 1
2625
2625
return out.view(bool )
2626
2626
else :
2627
2627
for i in range (count):
@@ -2649,7 +2649,7 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
2649
2649
ldom = _month_offset[isleap, dts.month]
2650
2650
2651
2651
if (dts.month == end_month) and ((ldom == doy and dow < 5 ) or (dow == 4 and (ldom - doy <= 2 ))):
2652
- out[i] = 1
2652
+ out[i] = 1
2653
2653
return out.view(bool )
2654
2654
else :
2655
2655
for i in range (count):
@@ -2666,7 +2666,7 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
2666
2666
if (dts.month == end_month) and (ldom == doy):
2667
2667
out[i] = 1
2668
2668
return out.view(bool )
2669
-
2669
+
2670
2670
raise ValueError (" Field %s not supported" % field)
2671
2671
2672
2672
0 commit comments