(rolling_func)
return impl
Generate series rolling methods implementations with parameter ddof
Generate series rolling methods implementations with parameter ddof
Generate series rolling methods implementations with parameter ddof
def gen_hpat_pandas_series_rolling_ddof_impl(rolling_func):
    """Generate series rolling methods implementations with parameter ddof"""
    def impl(self, ddof=1):
        win = self._window
        minp = self._min_periods

        input_series = self._data
        input_arr = input_series._data
        length = len(input_arr)
        output_arr = numpy.empty(length, dtype=float64)

        def apply_minp(arr, ddof, minp):
            finite_arr = arr[numpy.isfinite(arr)]
            if len(finite_arr) < minp:
                return numpy.nan
            else:
                return rolling_func(finite_arr, ddof)

        boundary = min(win, length)
        for i in prange(boundary):
            arr_range = input_arr[:i + 1]
            output_arr[i] = apply_minp(arr_range, ddof, minp)

        for i in prange(boundary, length):
            arr_range = input_arr[i + 1 - win:i + 1]
            output_arr[i] = apply_minp(arr_range, ddof, minp)

        return pandas.Series(output_arr, input_series._index, name=input_series._name)

    return impl
def gen_hpat_pandas_series_rolling_ddof_impl ( rolling_func ) : def impl ( self , ddof = 1 ) : win = self . _window minp = self . _min_periods input_series = self . _data input_arr = input_series . _data length = len ( input_arr ) output_arr = numpy . empty ( length , dtype = float64 ) def apply_minp ( arr , ddof , minp ) : finite_arr = arr [ numpy . isfinite ( arr ) ] if len ( finite_arr ) < minp : return numpy . nan else : return rolling_func ( finite_arr , ddof ) boundary = min ( win , length ) for i in prange ( boundary ) : arr_range = input_arr [ : i + 1 ] output_arr [ i ] = apply_minp ( arr_range , ddof , minp ) for i in prange ( boundary , length ) : arr_range = input_arr [ i + 1 - win : i + 1 ] output_arr [ i ] = apply_minp ( arr_range , ddof , minp ) return pandas . Series ( output_arr , input_series . _index , name = input_series . _name ) return impl