-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Length mismatch #68
Comments
Hi, I'm wondering whether there has been an update to this? I'm getting a similar error message when working through the doppelganger_example_full.ipynb (though I am running python 3.6):
`--------------------------------------------------------------------------- ~/anaconda3/lib/python3.6/site-packages/doppelganger/allocation.py in from_cleaned_data(marginals, households_data, persons_data) ~/anaconda3/lib/python3.6/site-packages/doppelganger/allocation.py in _format_data(households_data, persons_data) ~/anaconda3/lib/python3.6/site-packages/pandas/core/generic.py in setattr(self, name, value) pandas/_libs/properties.pyx in pandas._libs.properties.AxisProperty.set() ~/anaconda3/lib/python3.6/site-packages/pandas/core/generic.py in _set_axis(self, axis, labels) ~/anaconda3/lib/python3.6/site-packages/pandas/core/internals.py in set_axis(self, axis, new_labels) ValueError: Length mismatch: Expected axis has 0 elements, new values have 4 elements |
Hi, This seems to be caused by a version mismatch issue with cvxpy. To check which version is running, put the following (hacky) code near the top of your notebook:
EDIT: This seems to have encountered before in #57 |
Hi, @LachlanBirdsey Many thanks! `--------------------------------------------------------------------------- /Users/darebrawley/anaconda3/envs/panda_kernl2/lib/python2.7/site-packages/doppelganger/allocation.pyc in from_cleaned_data(marginals, households_data, persons_data) /Users/darebrawley/anaconda3/envs/panda_kernl2/lib/python2.7/site-packages/doppelganger/allocation.pyc in _format_data(households_data, persons_data) /Users/darebrawley/anaconda3/envs/panda_kernl2/lib/python2.7/site-packages/pandas/core/generic.pyc in setattr(self, name, value) pandas/_libs/properties.pyx in pandas._libs.properties.AxisProperty.set() /Users/darebrawley/anaconda3/envs/panda_kernl2/lib/python2.7/site-packages/pandas/core/generic.pyc in _set_axis(self, axis, labels) /Users/darebrawley/anaconda3/envs/panda_kernl2/lib/python2.7/site-packages/pandas/core/internals/managers.pyc in set_axis(self, axis, new_labels) ValueError: Length mismatch: Expected axis has 0 elements, new values have 4 elements` |
Hi, One potential fix is to remove the puma=PUMA parameter in households_data = PumsData.from_csv(... Hopefully this helps. |
Yes! amazing. Thank you @LachlanBirdsey However, when attempting to run: in "Step 03: Replace the PUMS Persons with Synthetic Persons created from the Bayesian Network" I get the error message included below. Any chance you have any suggestions here? `--------------------------------------------------------------------------- /Users/darebrawley/anaconda3/envs/panda_kernl2/lib/python2.7/site-packages/doppelganger/populationgen.pyc in generate(household_allocator, person_model, household_model) /Users/darebrawley/anaconda3/envs/panda_kernl2/lib/python2.7/site-packages/doppelganger/populationgen.pyc in _generate_from_model(household_allocator, data, model, fields, evidence_fn) /Users/darebrawley/anaconda3/envs/panda_kernl2/lib/python2.7/site-packages/doppelganger/bayesnets.pyc in generate(self, type_, evidence, count) /Users/darebrawley/anaconda3/envs/panda_kernl2/lib/python2.7/site-packages/doppelganger/bayesnets.pyc in ((_,)) /Users/darebrawley/anaconda3/envs/panda_kernl2/lib/python2.7/site-packages/doppelganger/bayesnets.pyc in ((distribution,)) AttributeError: 'unicode' object has no attribute 'sample'` |
Hi @darebrawley, Firstly, I would check to see which version of pomegranate you have installed. Doppelganger has a requirement of |
Hi
I'm using the sample data and trying to run the example provided in doppelganger_example_full.ipynb. However, I get this error and cannot figure out what's the problem. Can you please help me with it?
The text was updated successfully, but these errors were encountered: