I tried to read the cpc_outlook data using the git repo (GitHub - drivendataorg/water-supply-forecast-rodeo-runtime: Data and runtime repository for the Water Supply Forecast Rodeo competition on DrivenData), I received an error. The error appears with some of the data like 2005-01-08, 2005-01-15, etc. Is the data downloaded formatted wrong? BTW I’m using this same repo to download the data too.
from wsfr_read.climate import cpc_outlooks
from wsfr_read.streamflow import usgs_streamflow
from wsfr_read.teleconnections import mjo, oni, pdo, pna, soi
cpc_outlooks.read_cpc_outlooks_precip('2005-01-01', 'hungry_horse_reservoir_inflow')
TypeError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/pandas/core/indexes/base.py in get_loc(self, key)
3789 try:
→ 3790 return self._engine.get_loc(casted_key)
3791 except KeyError as err:
index.pyx in pandas._libs.index.IndexEngine.get_loc()
index.pyx in pandas._libs.index.IndexEngine.get_loc()
TypeError: ‘[20, 21]’ is an invalid key
During handling of the above exception, another exception occurred:
InvalidIndexError Traceback (most recent call last)
13 frames
InvalidIndexError: [20, 21]
During handling of the above exception, another exception occurred:
KeyError Traceback (most recent call last)
/usr/local/lib/python3.10/dist-packages/pandas/core/indexes/multi.py in _get_level_indexer(self, key, level, indexer)
3287 if not locs.any():
3288 # The label is present in self.levels[level] but unused:
→ 3289 raise KeyError(key)
3290 return locs
3291
KeyError: 20