[Numpy-discussion] nan result from np.linalg.lstsq()

Pauli Virtanen pav@iki...
Mon Oct 29 03:50:30 CDT 2012


Larry Paltrow <larry.paltrow <at> gmail.com> writes:
> I'm having some trouble using the linalg.lstsq() function
> with certain data and trying to understand why. It's
> always returning nans when I feed it this numpy array of float64 data:
> 
> data = df.close.values #coming from a pandas dataframe
> 
> type(data)
> >>> numpy.ndarray

Maybe you have NaNs in the array? (i.e. np.isnan(data) is True)

-- 
Pauli Virtanen




More information about the NumPy-Discussion mailing list