Skip to main content
`Ctrl`+`K`

# pandas.api.typing.Rolling.first

Rolling.first(numeric_only=False)

  Calculate the rolling First (left-most) element of the window.

  Parameters:
    numeric_only bool, default False

      Include only float, int, boolean columns.

  Returns:
    Series or DataFrame

      Return type is the same as the original object with `np.float64` dtype.

  See also

  `GroupBy.first`

    Similar method for GroupBy objects.

  `Rolling.last`

    Method to get the last element in each window.

  Examples

  The example below will show a rolling calculation with a window size of three.

      >>> s = pd.Series(range(5))
      >>> s.rolling(3).first()
      0         NaN
      1         NaN
      2         0.0
      3         1.0
      4         2.0
      dtype: float64