I have tried with both the (pandas)pd.ols and the (statsmodels)sm.ols to get a regression scatter plot with the regression line, I can get the scatter plot but I ca
Check what values you have in your arrays and variables.
My guess is that your x is just nans, because you use Python's min and max. At least that happens with the version of Pandas that I have currently open.
The min and max methods should work, since they know how to handle nan
s or missing values
>>> x = pd.Series([np.nan,2], index=['const','slope'])
>>> x
const NaN
slope 2
dtype: float64
>>> min(x)
nan
>>> max(x)
nan
>>> x.min()
2.0
>>> x.max()
2.0