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
>>> common_dtype = np.find_common_type(list(xdf.dtypes), [])
>>> if common_dtype is np.dtype('object'): raise ValueError('dtype cannot be converted to numeric')
else: x = np.asarray(xdf, dtype=common_dtype)
this doesn't require a minimum numeric dtype, maybe we want at least float32 if someone wants to calculate in single precision.
Activity
jseabold commentedon Jun 20, 2013
X has dtype of object.
I wonder if this worked with older versions of pandas.
jburroni commentedon Jun 20, 2013
this is not a step to reproduce. Sorry
josef-pkt commentedon Jun 20, 2013
I'm using pandas 0.7.3 and get the same casting
for numpy >=1.6
np.result_type(arr, np.float64)can be used to find common dtypejosef-pkt commentedon Jun 20, 2013
one possibility with pandas dataframes:
this doesn't require a minimum numeric dtype, maybe we want at least float32 if someone wants to calculate in single precision.
jseabold commentedon May 28, 2014
Bumping this. Contacted off-list about the same issue. I guess we need to cast object dtypes or maybe we should just raise?
jseabold commentedon May 28, 2014
Really we should have comprehensive handling of dtypes, including single precision, etc. Might be a decent amount of work though. We'd have to check.
josef-pkt commentedon Jun 3, 2014
asked on the mailinglist: automatic conversion of dates in exog
ENH: Better error message on object dtype. Closes statsmodels#880
ENH: Better error message on object dtype. Closes statsmodels#880
Merge commit 'v0.5.0-1491-g850e0e4' into debian-experimental