Closed danilociaffi closed 4 years ago
can you post a snippet of your household demographics file please @danilociaffi
Sure. These are the first 10 rows:
a_0_9,a_10_19,a_20_29,a_30_39,a_40_49,a_50_59,a_60_69,a_70_79,a_80
0,0,0,1,0,0,2,0,0
0,1,0,0,0,1,0,0,0
1,1,0,0,2,0,0,0,0
0,0,0,1,0,0,0,0,0
0,2,0,0,2,0,0,0,0
0,0,0,0,0,0,0,1,0
0,0,0,0,0,0,0,2,0
0,2,0,0,2,0,0,0,0
0,1,1,0,2,0,0,0,0
0,0,0,0,0,0,0,1,0
...
We also cut to 10,000 lines to have it the same size as the original household.
For ease of comparison, here are the fist 10 rows of the original file:
a_0_9,a_10_19,a_20_29,a_30_39,a_40_49,a_50_59,a_60_69,a_70_79,a_80
0,0,0,0,2,0,0,0,0
0,1,0,0,0,0,0,0,0
0,0,0,1,0,0,2,0,0
0,2,0,0,1,0,0,0,0
0,0,1,0,1,0,0,0,0
0,0,2,0,0,0,0,0,0
0,0,0,0,1,0,0,0,0
0,0,0,0,0,0,0,1,0
0,0,0,0,1,0,1,1,0
1,2,0,2,0,0,0,0,0
...
Can you try loading it in pandas and passing the data frame to the params object? Its a bit slower but does the allocation on the fly
so
households = pd.read_csv("path")
params = Parameters(baseline_params, hosehold_params=households)
Still breaks the kernel. However, I realized three of the rows had a household with more than 6 people, removing those made everything work (although still doesn't explain why the kernel breaks rather than returning an error message, but I reckon you probably have more important things to take care of).
Thank you for your assistance and your work!
I changed the
baseline_household_demographic.csv
file in the repo to replace it with the same data about my country. When I runmodel = Model(params)
in Jupyter the kernel dies and I get the following message:Note that I changed
baseline_parameters.csv
accordingly, so the population sampled in the households follows the same distribution as stated in the parameter file, and if I run the new parameter with the old household everything works fine.Any idea on what's the problem here?