Linear Regression [error]

This screenshot is here. Check it out, please.
It is showing errors as NaN values and I’m not able to resolve it. Maybe it is because of Python 2 library.
“The code is about Linear Regression formulae”.
Thank You.

epochs = 0
while(epochs < 1000):
y = theta_0 + theta_1 * x_train
error = y - y_train
mean_square_error = np.sum(error ** 2)
mean_square_error = mean_square_error/700
if(abs(mean_square_error) <= 0.01):
break
theta_0 = theta_0 - 0.0001 * 2 * np.sum(error)/700
theta_1 = theta_1 - 0.0001 * 2 * np.sum(error * x_train)/700
epochs += 1
if(epochs % 10 == 0):
print(mean_square_error)

Hello,

The NaN means not a number, where is y_train , theta0, theta1, xtrain?