@@ -148,7 +148,7 @@ cdef inline bint _is_fixed_offset(object tz):
148148 else :
149149 return 0
150150 return 1
151-
151+
152152
153153_zero_time = datetime_time(0 , 0 )
154154
@@ -340,7 +340,7 @@ class Timestamp(_Timestamp):
340340 @property
341341 def is_year_end (self ):
342342 return self ._get_start_end_field(' is_year_end' )
343-
343+
344344 def tz_localize (self , tz ):
345345 """
346346 Convert naive Timestamp to local time zone
@@ -994,7 +994,7 @@ cdef inline void _localize_tso(_TSObject obj, object tz):
994994 pandas_datetime_to_datetimestruct(obj.value + deltas[0 ],
995995 PANDAS_FR_ns, & obj.dts)
996996 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)
998998 obj.tzinfo = tz
999999 elif _treat_tz_as_pytz(tz):
10001000 inf = tz._transition_info[pos]
@@ -1044,7 +1044,7 @@ cdef inline object _get_zone(object tz):
10441044cpdef inline object maybe_get_tz(object tz):
10451045 '''
10461046 (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.
10481048 '''
10491049 if isinstance (tz, string_types):
10501050 if tz.startswith(' dateutil/' ):
@@ -1337,7 +1337,7 @@ def array_to_timedelta64(ndarray[object] values, coerce=False):
13371337def convert_to_timedelta (object ts , object unit = ' ns' , coerce = False ):
13381338 return convert_to_timedelta64(ts, unit, coerce )
13391339
1340- cdef convert_to_timedelta64(object ts, object unit, object coerce ):
1340+ cdef inline convert_to_timedelta64(object ts, object unit, object coerce ):
13411341 """
13421342 Convert an incoming object to a timedelta64 if possible
13431343
@@ -1952,9 +1952,9 @@ cdef inline bint _treat_tz_as_dateutil(object tz):
19521952cdef inline object _tz_cache_key(object tz):
19531953 """
19541954 Return the key in the cache for the timezone info object or None if unknown.
1955-
1955+
19561956 The key is currently the tz string for pytz timezones, the filename for dateutil timezones.
1957-
1957+
19581958 Notes
19591959 =====
19601960 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):
21362136 # right side
21372137 idx_shifted = _ensure_int64(
21382138 np.maximum(0 , trans.searchsorted(vals + DAY_NS, side = ' right' ) - 1 ))
2139-
2139+
21402140 for i in range (n):
21412141 v = vals[i] - deltas[idx_shifted[i]]
21422142 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
25162516
25172517 pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, & dts)
25182518 dom = dts.day
2519-
2519+
25202520 if dom == 1 :
25212521 out[i] = 1
25222522 return out.view(bool )
@@ -2534,7 +2534,7 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
25342534 doy = mo_off + dom
25352535 ldom = _month_offset[isleap, dts.month]
25362536 dow = ts_dayofweek(ts)
2537-
2537+
25382538 if (ldom == doy and dow < 5 ) or (dow == 4 and (ldom - doy <= 2 )):
25392539 out[i] = 1
25402540 return out.view(bool )
@@ -2548,9 +2548,9 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
25482548 dom = dts.day
25492549 doy = mo_off + dom
25502550 ldom = _month_offset[isleap, dts.month]
2551-
2551+
25522552 if ldom == doy:
2553- out[i] = 1
2553+ out[i] = 1
25542554 return out.view(bool )
25552555
25562556 elif field == ' is_quarter_start' :
@@ -2564,17 +2564,17 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
25642564 dow = ts_dayofweek(ts)
25652565
25662566 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
25682568 return out.view(bool )
25692569 else :
25702570 for i in range (count):
25712571 if dtindex[i] == NPY_NAT: out[i] = - 1 ; continue
25722572
25732573 pandas_datetime_to_datetimestruct(dtindex[i], PANDAS_FR_ns, & dts)
25742574 dom = dts.day
2575-
2575+
25762576 if ((dts.month - start_month) % 3 == 0 ) and dom == 1 :
2577- out[i] = 1
2577+ out[i] = 1
25782578 return out.view(bool )
25792579
25802580 elif field == ' is_quarter_end' :
@@ -2590,9 +2590,9 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
25902590 doy = mo_off + dom
25912591 ldom = _month_offset[isleap, dts.month]
25922592 dow = ts_dayofweek(ts)
2593-
2593+
25942594 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
25962596 return out.view(bool )
25972597 else :
25982598 for i in range (count):
@@ -2604,9 +2604,9 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
26042604 dom = dts.day
26052605 doy = mo_off + dom
26062606 ldom = _month_offset[isleap, dts.month]
2607-
2607+
26082608 if ((dts.month - end_month) % 3 == 0 ) and (ldom == doy):
2609- out[i] = 1
2609+ out[i] = 1
26102610 return out.view(bool )
26112611
26122612 elif field == ' is_year_start' :
@@ -2620,7 +2620,7 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
26202620 dow = ts_dayofweek(ts)
26212621
26222622 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
26242624 return out.view(bool )
26252625 else :
26262626 for i in range (count):
@@ -2648,7 +2648,7 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
26482648 ldom = _month_offset[isleap, dts.month]
26492649
26502650 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
26522652 return out.view(bool )
26532653 else :
26542654 for i in range (count):
@@ -2665,7 +2665,7 @@ def get_start_end_field(ndarray[int64_t] dtindex, object field, object freqstr=N
26652665 if (dts.month == end_month) and (ldom == doy):
26662666 out[i] = 1
26672667 return out.view(bool )
2668-
2668+
26692669 raise ValueError (" Field %s not supported" % field)
26702670
26712671
0 commit comments