Why I am having ValueError in this Linear Regression? from sklearn.linear_model import LinearRegression

ClosePrices = data['Close'].tolist()
OpenPrices = data['Open'].tolist()


OpenPrices = np.reshape(OpenPrices, (len(OpenPrices), 1))
ClosePrices = np.reshape(ClosePrices, (len(ClosePrices), 1))

regressor = LinearRegression()
regressor.fit(OpenPrices, ClosePrices)


I am having the error 

ValueError: Input contains NaN, infinity or a value too large for dtype('float64').


What is the solution?
There are most likely missing values in your data, those missing values are encoded as NaN.

The most common solutions for missing data are:


Drop the instances/rows that have any missing values.
Impute the missing values.