'ML/OLS Regression- keep getting ValueError: zero-size array to reduction operation maximum which has no identity
I keep getting the error "ValueError: zero-size array to reduction operation maximum which has no identity"
I transformed a few arrays from object to float64. I ran display and there are no nulls, so I'm not sure what I need to transform still.
y_sm = euifourcities_sub['site_eui']
x_sm = euifourcities_sub [['max_temp', 'min_temp',
'year_built', 'average_dni',
'owner_occupied', 'tenant_occupied',
'pop_65_older','pop_poverty',
'auditsandretrocommissionsrequire',
'tuneupsrequiredyn', 'statepolicyyn',
'prop_type_coded', 'builtbefore1960',
'lnhousehold_income_median', 'lnsf']]
x_sm = sm.add_constant(x_sm)
np.asarray(euifourcities_sub)
ols_model = sm.OLS(y_sm, x_sm, missing = 'drop').fit()
print(ols_model.summary()) # standardized coefficients
error message: 10 frames <array_function internals> in ptp(*args, **kwargs)
/usr/local/lib/python3.7/dist-packages/numpy/core/_methods.py
in _ptp(a, axis, out, keepdims)
274 def _ptp(a, axis=None, out=None, keepdims=False):
275 return um.subtract(
--> 276 umr_maximum(a, axis, None, out, keepdims),
277 umr_minimum(a, axis, None, None, keepdims),
278 out
ValueError: zero-size array to reduction operation maximum
which has no identity
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
