Skip to content
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

issue with cvxpy.Variable functions in example code #70

Open
b-ganesh opened this issue Feb 21, 2020 · 0 comments
Open

issue with cvxpy.Variable functions in example code #70

b-ganesh opened this issue Feb 21, 2020 · 0 comments

Comments

@b-ganesh
Copy link

Hi there, I am running into an issue during the allocation step when I try to run your example code. I am currently using Python 3 and I am getting the following error. Any help on this issue would be much appreciated- thanks so much!

TypeError Traceback (most recent call last)
in
----> 1 allocator = HouseholdAllocator.from_cleaned_data(controls, households_data, persons_data)

~/anaconda3/lib/python3.7/site-packages/doppelganger/allocation.py in from_cleaned_data(marginals, households_data, persons_data)
77 households_data.data, persons_data.data)
78 allocated_households, allocated_persons =
---> 79 HouseholdAllocator._allocate_households(households, persons, marginals)
80 return HouseholdAllocator(allocated_households, allocated_persons)
81

~/anaconda3/lib/python3.7/site-packages/doppelganger/allocation.py in _allocate_households(households, persons, tract_controls)
174
175 hh_weights = balance_multi_cvx(
--> 176 hh_table, A, B, w_extend, gamma * mu_extend.T, meta_gamma
177 )
178

~/anaconda3/lib/python3.7/site-packages/doppelganger/listbalancer.py in balance_multi_cvx(hh_table, A, B, w, mu, meta_mu, verbose_solver)
121
122 n_tracts = w.shape[0]
--> 123 x = cvx.Variable(n_tracts, n_samples)
124
125 # Relative weights of tracts

~/anaconda3/lib/python3.7/site-packages/cvxpy/expressions/variable.py in init(self, shape, name, var_id, **kwargs)
73 self._name = name
74 else:
---> 75 raise TypeError("Variable name %s must be a string." % name)
76
77 self._value = None

TypeError: Variable name 917 must be a string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant