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

Cannot reshape array #21

Open
hermelino opened this issue May 27, 2022 · 2 comments
Open

Cannot reshape array #21

hermelino opened this issue May 27, 2022 · 2 comments

Comments

@hermelino
Copy link

I'm trying to run a synthetic control model with my data and I'm getting the error message below. Can someone help me, please?

Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\SyntheticControlMethods\main.py", line 333, in init
original_checked_input = self._process_input_data(
File "C:\ProgramData\Anaconda3\lib\site-packages\SyntheticControlMethods\main.py", line 175, in _process_input_data
control_outcome_all, control_outcome, unscaled_control_covariates = self._process_control_data(
File "C:\ProgramData\Anaconda3\lib\site-packages\SyntheticControlMethods\main.py", line 243, in _process_control_data
control_outcome_all = np.array(control_data_all[outcome_var]).reshape(n_controls, periods_all).T #All outcomes
ValueError: cannot reshape array of size 773 into shape (43,18)

@hermelino
Copy link
Author

The data I'm using has all the same length, so I don't have idea how to solve this.

@rb-jet
Copy link

rb-jet commented Feb 13, 2023

I had the same issue, you should check that you have a record for each combination of unit and time period. If you have a unit without a record for a given time period, you'll get this.

Mine weren't complete, once I removed those units, it fully run

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

2 participants