Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pipelines/assets/livelihood_activity.py
Original file line number Diff line number Diff line change
Expand Up @@ -1337,6 +1337,9 @@ def get_annotated_instances_from_dataframe(
# Annotate the output metadata with completeness information
# Get the summary dataframe, grouped by strategy_type
summary_df = pd.DataFrame(reported_summary_output.value["LivelihoodActivity"])
for col in ["income", "expenditure", "kcals_consumed"]:
summary_df[col] = pd.to_numeric(summary_df[col], errors="coerce")

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@girum-air Do we need to add .fillna(0) so that groupby().sum() below doesn't return nan?

summary_df = (
summary_df[["strategy_type", "income", "expenditure", "kcals_consumed"]].groupby("strategy_type").sum()
)
Expand Down