code: def tn_max(tasmin, freq='YS'):
      r
  
      return tasmin.resample(time=freq).max(dim='time', keep_attrs=True)
docs: r"""Highest minimum temperature.
  
      The maximum of daily minimum temperature.
  
      Parameters
      ----------
      tasmin : xarray.DataArray
        Minimum daily temperature [℃] or [K]
      freq : str, optional
        Resampling frequency
  
      Returns
      -------
      xarray.DataArray
        Maximum of daily minimum temperature.
  
      Notes
      -----
      Let :math:`TN_{ij}` be the minimum temperature at day :math:`i` of period :math:`j`. Then the maximum
      daily minimum temperature for period :math:`j` is:
  
      .. math::
  
          TNx_j = max(TN_{ij})