

def datetime_average_temperature(self, dt, unit):
    'The daily average temperatures for a particular period.\n\n        Parameters\n        ----------\n        dt : datetime.datetime or datetime.date\n            The date for which to find or calculate the average temperature.\n        unit : {"degC", "degF"}\n            The unit in which the daily average temperature should be returned.\n\n        Returns\n        -------\n        out : np.ndarray\n            Average temperature observed.\n        '
    try:
        value = value.tempC[dt.strftime('%Y-%m-%d')].mean()
        return self._unit_convert(value, unit)
    except KeyError:
        try:
            self._fetch_datetime(dt)
            value = self.tempC[dt.strftime('%Y-%m-%d')].mean()
            return self._unit_convert(value, unit)
        except KeyError:
            pass
    return np.nan

dataset/ETHPy150Open impactlab/eemeter/eemeter/weather.py WeatherSourceBase.datetime_average_temperature/VarMisuse@22/163 `self`->`value`