I have the pandas data frame with some of the categorical predictors or variables as 0 & 1, and some of the numeric variables. When I fit that to a stasmodel like below :
est = sm.OLS(y, X).fit()
It throws the below error :
Pandas data cast to numpy dtype of object. Check input data with np.asarray(data).
I tried to convert all of the the dtypes of the DataFrame using below code:
After this all the dtypes of dataframe variables appeaerd as int32 or int64. But at the end of it, it still shows the dtype: object, like below :
Here 5516, 5523 are variable labels.
Any clue? I just need to build the multi-regression model on more than the hundreds of variables. For that I have concatenated the 3 pandas DataFrames to come up with the final DataFrame to be used in the model building.