You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When working with Float64 values form pandas, sm.OLS raises an error
ValueError: Pandas data cast to numpy dtype of object. Check input data with np.asarray(data).
Example
impor pandas as pd
import statsmodels.api as sm
x = pd.Series([1,2,3,4]).astype('Float64')
y = pd.Series([1,2,3,4]).astype('Float64')
sm.OLS(y,x).fit()
It is easy to convert the Float64 into a float64 value, but it would be nice if sm.OLS can handle that.
The text was updated successfully, but these errors were encountered:
There is no support for extension arrays. While in your case it is simple to convert, how should pd.NA and np.nan be handled in an array that contained these?
When working with
Float64
values formpandas
,sm.OLS
raises an errorValueError: Pandas data cast to numpy dtype of object. Check input data with np.asarray(data).
Example
It is easy to convert the
Float64
into afloat64
value, but it would be nice ifsm.OLS
can handle that.The text was updated successfully, but these errors were encountered: