def add_year(self, year, force=False):
        """Adds temperature data to internal pandas timeseries

        Parameters
        ----------
        year : {int, string}
            The year for which data should be fetched, e.g. "2010".
        force : bool, default=False
            If True, forces the fetch; if false, checks to see if year
            has been added before actually fetching.
        """

        if not force and self._year_fetch_attempted(year):
            if self._year_in_series(year):
                return
            else:
                dates = pd.date_range("{}-01-01".format(year),"{}-12-31".format(year), freq=self.freq)
                new_series = pd.Series(None, index=dates, dtype=float)
                self.tempC = self.tempC.append(new_series).sort_index().resample(self.freq).mean()
                self.save_to_cache()
                return

        data = self.client.get_gsod_data(self.station, year)
        dates = pd.date_range("{}-01-01".format(year),"{}-12-31".format(year), freq=self.freq)
        new_series = pd.Series(None, index=dates, dtype=float)
        for day in data:
            if not pd.isnull(day["temp_C"]):
                new_series[day["date"]] = day["temp_C"]

        # changed for pandas > 0.18
        self.tempC = self.tempC.append(new_series).sort_index().resample(self.freq).mean()
        self.save_to_cache()
        self._year_fetches_attempted.add(year)
dataset/ETHPy150Open impactlab/eemeter/eemeter/weather.py/GSODWeatherSource.add_year/original