请帮我解决这个错误。
这是我的代码。
import statsmodels.formula.api as sm
X = np.append(arr=np.ones((50,1)).astype(int),values=X,axis=1)
x_opt=X[:,[0,1,2,3,4,5]]
regressor_OLS = sm.OLS(endog = Y,exog=x_opt).fit()
regressor_OLS.summary()
这是错误信息。
**TypeError: ufunc 'isfinite' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''**