diff --git a/pandas/src/period.pyx b/pandas/src/period.pyx index b431bb58bc991..cfc50afc8f9f3 100644 --- a/pandas/src/period.pyx +++ b/pandas/src/period.pyx @@ -20,6 +20,7 @@ from pandas import compat from pandas.tseries import offsets from pandas.tseries.tools import parse_time_string +cimport cython from datetime cimport * cimport util cimport lib @@ -124,6 +125,8 @@ cdef inline int64_t remove_mult(int64_t period_ord_w_mult, int64_t mult): return period_ord_w_mult * mult + 1; +@cython.wraparound(False) +@cython.boundscheck(False) def dt64arr_to_periodarr(ndarray[int64_t] dtarr, int freq, tz=None): """ Convert array of datetime64 values (passed in as 'i8' dtype) to a set of @@ -151,6 +154,8 @@ def dt64arr_to_periodarr(ndarray[int64_t] dtarr, int freq, tz=None): out = localize_dt64arr_to_period(dtarr, freq, tz) return out +@cython.wraparound(False) +@cython.boundscheck(False) def periodarr_to_dt64arr(ndarray[int64_t] periodarr, int freq): """ Convert array to datetime64 values from a set of ordinals corresponding to diff --git a/pandas/tslib.pyx b/pandas/tslib.pyx index 8e6d4019c69a3..2fa406f880cdd 100644 --- a/pandas/tslib.pyx +++ b/pandas/tslib.pyx @@ -4431,7 +4431,7 @@ def shift_months(int64_t[:] dtindex, int months, object day=None): Py_ssize_t i pandas_datetimestruct dts int count = len(dtindex) - cdef int days_in_current_month + int days_in_current_month int64_t[:] out = np.empty(count, dtype='int64') if day is None: