AIStream-Peelout / flow-forecast

Deep learning PyTorch library for time series forecasting, classification, and anomaly detection (originally for flood forecasting).
https://flow-forecast.atlassian.net/wiki/spaces/FF/overview
GNU General Public License v3.0
2.01k stars 289 forks source link

Interpolate only works with flow precipitation data #119

Open isaacmg opened 4 years ago

isaacmg commented 4 years ago

Users of flow forecast might want to interpolate data automatically using one of our pre-defined methods.

Traceback (most recent call last):
  File "/home/circleci/repo/tests/data_loader_tests.py", line 28, in setUp
    target_col=['cfs'], relevant_cols=['cfs', 'precip', 'temp'])
  File "/home/circleci/repo/flood_forecast/preprocessing/pytorch_loaders.py", line 50, in __init__
    df = interpolate_missing_values(df)
  File "/home/circleci/repo/flood_forecast/preprocessing/interpolate_preprocess.py", line 26, in interpolate_missing_values
    df['precip'] = df['p01m'].interpolate(method='nearest').ffill().bfill()
  File "/usr/local/lib/python3.7/site-packages/pandas/core/frame.py", line 2800, in __getitem__
    indexer = self.columns.get_loc(key)
  File "/usr/local/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 2648, in get_loc
    return self._engine.get_loc(self._maybe_cast_indexer(key))
  File "pandas/_libs/index.pyx", line 111, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 138, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 1619, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 1627, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'p01m'
isaacmg commented 3 years ago

This has now been fixed