Skip to content

Commit

Permalink
fix(iamc.resolver): Fix iamc_aggregate to return NaN instead of 0 for…
Browse files Browse the repository at this point in the history
… non-existent years (#62)
  • Loading branch information
coroa authored Dec 1, 2024
1 parent df9f347 commit f8c6b45
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/pandas_indexing/iamc/resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,7 @@ def __getitem__(self, value: str) -> Vars:
)
else:
vars = Vars.from_data(
self.external_data[prefix],
rem_value,
provenance=value,
context=self.context,
data, rem_value, provenance=value, context=self.context
)
except (KeyError, ValueError):
vars = Vars([], context=self.context)
Expand Down Expand Up @@ -580,7 +577,7 @@ def iamc_aggregate(self, value: str, **overwrites) -> Vars:
]
)
.groupby(self.data.index.names.difference([self.context.level]))
.sum()
.sum(min_count=1)
)
if data.empty:
return Vars([], self.context)
Expand Down

0 comments on commit f8c6b45

Please sign in to comment.