diff --git a/scripts/build_hydro_profile.py b/scripts/build_hydro_profile.py index cd51ce90..f1e56532 100644 --- a/scripts/build_hydro_profile.py +++ b/scripts/build_hydro_profile.py @@ -139,7 +139,8 @@ def approximate_missing_eia_stats(eia_stats, runoff_fn, countries): runoff.index = runoff.index.astype(int) # fix outliers; exceptional floods in 1977-1979 in ES & PT - runoff.loc[1978, ["ES", "PT"]] = runoff.loc[1979, ["ES", "PT"]] + if ("ES" and "PT") in runoff: + runoff.loc[1978, ["ES", "PT"]] = runoff.loc[1979, ["ES", "PT"]] runoff_eia = runoff.loc[eia_stats.index]