Fix that code works if either ES or PT is present
This commit is contained in:
parent
a184f159c0
commit
3b77b4a370
@ -139,8 +139,10 @@ def approximate_missing_eia_stats(eia_stats, runoff_fn, countries):
|
|||||||
runoff.index = runoff.index.astype(int)
|
runoff.index = runoff.index.astype(int)
|
||||||
|
|
||||||
# fix outliers; exceptional floods in 1977-1979 in ES & PT
|
# fix outliers; exceptional floods in 1977-1979 in ES & PT
|
||||||
if ("ES" and "PT") in runoff:
|
if "ES" in runoff:
|
||||||
runoff.loc[1978, ["ES", "PT"]] = runoff.loc[1979, ["ES", "PT"]]
|
runoff.loc[1978, ["ES"]] = runoff.loc[1979, ["ES"]]
|
||||||
|
if "PT" in runoff:
|
||||||
|
runoff.loc[1978, ["PT"]] = runoff.loc[1979, ["PT"]]
|
||||||
|
|
||||||
runoff_eia = runoff.loc[eia_stats.index]
|
runoff_eia = runoff.loc[eia_stats.index]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user