(self, periods=1, freq=None, axis=0, fill_value=None)
return hpat_pandas_series_shift_impl
Intel Scalable Dataframe Compiler User Guide
    ********************************************

    Pandas API: pandas.Series.shift

    Limitations
    -----------
    Parameters ``freq`` and ``axis`` are supported only with default values ``None`` and ``0`` respectively.

    Examples
    --------
    .. literalinclude:: ../../../examples/series/series_shift.py
       :language: python
       :lines: 36-
       :caption: Shift index by desired number of periods with an optional time freq.
       :name: ex_series_shift

    .. command-output:: python ./series/series_shift.py
       :cwd: ../../../examples

    Intel Scalable Dataframe Compiler Developer Guide
    *************************************************

    Pandas Series method :meth:`pandas.Series.shift` implementation.

    .. only:: developer
        Test: python -m sdc.runtests -k sdc.tests.test_series.TestSeries.test_series_shift*
Intel Scalable Dataframe Compiler User Guide
    ********************************************
Intel Scalable Dataframe Compiler User Guide ********************************************
def hpat_pandas_series_shift(self, periods=1, freq=None, axis=0, fill_value=None):
    """
    Intel Scalable Dataframe Compiler User Guide
    ********************************************

    Pandas API: pandas.Series.shift

    Limitations
    -----------
    Parameters ``freq`` and ``axis`` are supported only with default values ``None`` and ``0`` respectively.

    Examples
    --------
    .. literalinclude:: ../../../examples/series/series_shift.py
       :language: python
       :lines: 36-
       :caption: Shift index by desired number of periods with an optional time freq.
       :name: ex_series_shift

    .. command-output:: python ./series/series_shift.py
       :cwd: ../../../examples

    Intel Scalable Dataframe Compiler Developer Guide
    *************************************************

    Pandas Series method :meth:`pandas.Series.shift` implementation.

    .. only:: developer
        Test: python -m sdc.runtests -k sdc.tests.test_series.TestSeries.test_series_shift*
    """

    _func_name = 'Method shift().'

    ty_checker = TypeChecker(_func_name)
    ty_checker.check(self, SeriesType)

    if not isinstance(self.data.dtype, types.Number):
        ty_checker.raise_exc(self.data.dtype, 'number', 'self.data.dtype')

    if not isinstance(fill_value, (types.Omitted, types.Number, types.NoneType)) and fill_value is not None:
        ty_checker.raise_exc(fill_value, 'number', 'fill_value')

    if not isinstance(freq, (types.Omitted, types.NoneType)) and freq is not None:
        ty_checker.raise_exc(freq, 'None', 'freq')

    if not isinstance(axis, (types.Omitted, int, types.Integer)) and not axis:
        ty_checker.raise_exc(axis, 'int', 'axis')

    fill_is_default = isinstance(fill_value, (types.Omitted, types.NoneType)) or fill_value is None
    series_np_dtype = [numpy_support.as_dtype(self.data.dtype)]
    fill_np_dtype = [numpy.float64 if fill_is_default else numpy_support.as_dtype(fill_value)]

    fill_dtype = types.float64 if fill_is_default else fill_value
    common_dtype = find_common_dtype_from_numpy_dtypes([], [self.data.dtype, fill_dtype])

    if fill_is_default:
        def hpat_pandas_series_shift_impl(self, periods=1, freq=None, axis=0, fill_value=None):
            if axis != 0:
                raise TypingError('Method shift(). Unsupported parameters. Given axis != 0')

            arr = numpy.empty(shape=len(self._data), dtype=common_dtype)
            if periods > 0:
                arr[:periods] = numpy.nan
                arr[periods:] = self._data[:-periods]
            elif periods < 0:
                arr[periods:] = numpy.nan
                arr[:periods] = self._data[-periods:]
            else:
                arr[:] = self._data

            return pandas.Series(data=arr, index=self._index, name=self._name)

        return hpat_pandas_series_shift_impl

    def hpat_pandas_series_shift_impl(self, periods=1, freq=None, axis=0, fill_value=None):
        if axis != 0:
            raise TypingError('Method shift(). Unsupported parameters. Given axis != 0')

        arr = numpy.empty(len(self._data), dtype=common_dtype)
        if periods > 0:
            arr[:periods] = fill_value
            arr[periods:] = self._data[:-periods]
        elif periods < 0:
            arr[periods:] = fill_value
            arr[:periods] = self._data[-periods:]
        else:
            arr[:] = self._data

        return pandas.Series(data=arr, index=self._index, name=self._name)

    return hpat_pandas_series_shift_impl
def hpat_pandas_series_shift ( self , periods = 1 , freq = None , axis = 0 , fill_value = None ) : _func_name = 'Method shift().' ty_checker = TypeChecker ( _func_name ) ty_checker . check ( self , SeriesType ) if not isinstance ( self . data . dtype , types . Number ) : ty_checker . raise_exc ( self . data . dtype , 'number' , 'self.data.dtype' ) if not isinstance ( fill_value , ( types . Omitted , types . Number , types . NoneType ) ) and fill_value is not None : ty_checker . raise_exc ( fill_value , 'number' , 'fill_value' ) if not isinstance ( freq , ( types . Omitted , types . NoneType ) ) and freq is not None : ty_checker . raise_exc ( freq , 'None' , 'freq' ) if not isinstance ( axis , ( types . Omitted , int , types . Integer ) ) and not axis : ty_checker . raise_exc ( axis , 'int' , 'axis' ) fill_is_default = isinstance ( fill_value , ( types . Omitted , types . NoneType ) ) or fill_value is None series_np_dtype = [ numpy_support . as_dtype ( self . data . dtype ) ] fill_np_dtype = [ numpy . float64 if fill_is_default else numpy_support . as_dtype ( fill_value ) ] fill_dtype = types . float64 if fill_is_default else fill_value common_dtype = find_common_dtype_from_numpy_dtypes ( [ ] , [ self . data . dtype , fill_dtype ] ) if fill_is_default : def hpat_pandas_series_shift_impl ( self , periods = 1 , freq = None , axis = 0 , fill_value = None ) : if axis != 0 : raise TypingError ( 'Method shift(). Unsupported parameters. Given axis != 0' ) arr = numpy . empty ( shape = len ( self . _data ) , dtype = common_dtype ) if periods > 0 : arr [ : periods ] = numpy . nan arr [ periods : ] = self . _data [ : - periods ] elif periods < 0 : arr [ periods : ] = numpy . nan arr [ : periods ] = self . _data [ - periods : ] else : arr [ : ] = self . _data return pandas . Series ( data = arr , index = self . _index , name = self . _name ) return hpat_pandas_series_shift_impl def hpat_pandas_series_shift_impl ( self , periods = 1 , freq = None , axis = 0 , fill_value = None ) : if axis != 0 : raise TypingError ( 'Method shift(). Unsupported parameters. Given axis != 0' ) arr = numpy . empty ( len ( self . _data ) , dtype = common_dtype ) if periods > 0 : arr [ : periods ] = fill_value arr [ periods : ] = self . _data [ : - periods ] elif periods < 0 : arr [ periods : ] = fill_value arr [ : periods ] = self . _data [ - periods : ] else : arr [ : ] = self . _data return pandas . Series ( data = arr , index = self . _index , name = self . _name ) return hpat_pandas_series_shift_impl