def shift(self, periods: int=1, fill_value: Optional[Any]=None) -> 'DataFrame':
    "\n        Shift DataFrame by desired number of periods.\n\n        .. note:: the current implementation of shift uses Spark's Window without\n            specifying partition specification. This leads to move all data into\n            single partition in single machine and could cause serious\n            performance degradation. Avoid this method against very large dataset.\n\n        Parameters\n        ----------\n        periods : int\n            Number of periods to shift. Can be positive or negative.\n        fill_value : object, optional\n            The scalar value to use for newly introduced missing values.\n            The default depends on the dtype of self. For numeric data, np.nan is used.\n\n        Returns\n        -------\n        Copy of input DataFrame, shifted.\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({'Col1': [10, 20, 15, 30, 45],\n        ...                    'Col2': [13, 23, 18, 33, 48],\n        ...                    'Col3': [17, 27, 22, 37, 52]},\n        ...                   columns=['Col1', 'Col2', 'Col3'])\n\n        >>> df.shift(periods=3)\n           Col1  Col2  Col3\n        0   NaN   NaN   NaN\n        1   NaN   NaN   NaN\n        2   NaN   NaN   NaN\n        3  10.0  13.0  17.0\n        4  20.0  23.0  27.0\n\n        >>> df.shift(periods=3, fill_value=0)\n           Col1  Col2  Col3\n        0     0     0     0\n        1     0     0     0\n        2     0     0     0\n        3    10    13    17\n        4    20    23    27\n\n        "
    return self._apply_series_op((lambda psser: psser._shift(periods, fill_value)), should_resolve=True)
Shift DataFrame by desired number of periods.

.. note:: the current implementation of shift uses Spark's Window without
    specifying partition specification. This leads to move all data into
    single partition in single machine and could cause serious
    performance degradation. Avoid this method against very large dataset.

Parameters
----------
periods : int
    Number of periods to shift. Can be positive or negative.
fill_value : object, optional
    The scalar value to use for newly introduced missing values.
    The default depends on the dtype of self. For numeric data, np.nan is used.

Returns
-------
Copy of input DataFrame, shifted.

Examples
--------
>>> df = ps.DataFrame({'Col1': [10, 20, 15, 30, 45],
...                    'Col2': [13, 23, 18, 33, 48],
...                    'Col3': [17, 27, 22, 37, 52]},
...                   columns=['Col1', 'Col2', 'Col3'])

>>> df.shift(periods=3)
   Col1  Col2  Col3
0   NaN   NaN   NaN
1   NaN   NaN   NaN
2   NaN   NaN   NaN
3  10.0  13.0  17.0
4  20.0  23.0  27.0

>>> df.shift(periods=3, fill_value=0)
   Col1  Col2  Col3
0     0     0     0
1     0     0     0
2     0     0     0
3    10    13    17
4    20    23    27
def shift(self, periods: int=1, fill_value: Optional[Any]=None) -> 'DataFrame':
    "\n        Shift DataFrame by desired number of periods.\n\n        .. note:: the current implementation of shift uses Spark's Window without\n            specifying partition specification. This leads to move all data into\n            single partition in single machine and could cause serious\n            performance degradation. Avoid this method against very large dataset.\n\n        Parameters\n        ----------\n        periods : int\n            Number of periods to shift. Can be positive or negative.\n        fill_value : object, optional\n            The scalar value to use for newly introduced missing values.\n            The default depends on the dtype of self. For numeric data, np.nan is used.\n\n        Returns\n        -------\n        Copy of input DataFrame, shifted.\n\n        Examples\n        --------\n        >>> df = ps.DataFrame({'Col1': [10, 20, 15, 30, 45],\n        ...                    'Col2': [13, 23, 18, 33, 48],\n        ...                    'Col3': [17, 27, 22, 37, 52]},\n        ...                   columns=['Col1', 'Col2', 'Col3'])\n\n        >>> df.shift(periods=3)\n           Col1  Col2  Col3\n        0   NaN   NaN   NaN\n        1   NaN   NaN   NaN\n        2   NaN   NaN   NaN\n        3  10.0  13.0  17.0\n        4  20.0  23.0  27.0\n\n        >>> df.shift(periods=3, fill_value=0)\n           Col1  Col2  Col3\n        0     0     0     0\n        1     0     0     0\n        2     0     0     0\n        3    10    13    17\n        4    20    23    27\n\n        "
    return self._apply_series_op((lambda psser: psser._shift(periods, fill_value)), should_resolve=True)