# xarray.infer_freq

### xarray.infer_freq(index)[[source]](https://github.com/pydata/xarray/blob/main/xarray/coding/frequencies.py#L62-L109)

Infer the most likely frequency given the input index.

* **Parameters:**
  **index** ([`CFTimeIndex`](xarray.CFTimeIndex.html.md#xarray.CFTimeIndex), [`DataArray`](xarray.DataArray.html.md#xarray.DataArray), [`DatetimeIndex`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DatetimeIndex.html#pandas.DatetimeIndex), [`TimedeltaIndex`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.TimedeltaIndex.html#pandas.TimedeltaIndex), [`Series`](https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.Series.html#pandas.Series)) – If not passed a CFTimeIndex, this simply calls pandas.infer_freq.
  If passed a Series or a DataArray will use the values of the series (NOT THE INDEX).
* **Returns:**
  [`str`](https://docs.python.org/3/builtins/stdtypes.html#str) or [`None`](https://docs.python.org/3/builtins/constants.html#None) – None if no discernible frequency.
* **Raises:**
  * [**TypeError**](https://docs.python.org/3/builtins/exceptions.html#TypeError) – If the index is not datetime-like.
  * [**ValueError**](https://docs.python.org/3/builtins/exceptions.html#ValueError) – If there are fewer than three values or the index is not 1D.
