We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d006329 commit a98fa33Copy full SHA for a98fa33
1 file changed
pipelines/assets/livelihood_activity.py
@@ -846,6 +846,15 @@ def get_instances_from_dataframe(
846
# worksheets
847
column = df.columns[i + 1]
848
household_size = df.iloc[3, i + 1]
849
+ # Convert household_size to int
850
+ try:
851
+ if pd.notna(household_size) and household_size != "":
852
+ # Convert to float first to handle "5.0" or "5.7", then to int
853
+ household_size = int(float(household_size))
854
+ else:
855
+ household_size = None
856
+ except (ValueError, TypeError):
857
858
livelihood_activity["kcals_consumed"] = (
859
livelihood_activity["percentage_kcals"] * 2100 * 365 * household_size
860
if livelihood_activity["percentage_kcals"] and household_size
0 commit comments