Closed joshjacobson closed 7 years ago
Any chance you could upload some example data so I could reproduce this on my side?
Yep, unzip the attached file Vote_Selling_Survey_Data.dta.zip or download it from here: https://www.aeaweb.org/aer/data/10505/P2015_1033_data.zip
And then this code will raise the error:
import pandas as pd
from fancyimpute import MICE
X_incomplete = pd.read_stata('Vote_Selling_Survey_Data.dta')
X_incomplete = pd.get_dummies(X_incomplete)
X_filled_mice = MICE(n_imputations=1).complete(X_incomplete)
Oh it's that thing where we expect a numpy array. Just do this instead:
X_filled_mice = MICE(n_imputations=1).complete(X_incomplete.values)
I'll change it in the code so it converts all of the inputs into numpy arrays.