title: I’m experiencing a difficulty with "name 'x' is not defined" in jupyter notebook
body: <pre><code>import pandas as pd
  import numpy as np
  import matplotlib.pyplot as plt
  from sklearn.linear_model import LinearRegression
  from sklearn.metrics import r2_score
  import statsmodels.api as sm
  
  
  def train(x, y):
      from sklearn.linear_model import LinearRegression
      model = LinearRegression().fit(x,y)
      return model
  data = pd.read_csv("/home/andand/Downloads/Advertising.csv")
  model = train(x,y)
  
  x_new = 23.0
  y_new = model.predict(x_new)
  
  print(y_new)
  
  
  
  
  NameError                                 Traceback (most recent call last)
  &lt;ipython-input-4-d0295eb57fc4&gt; in &lt;module&gt;
       11     return model
       12 data = pd.read_csv("/home/andand/Downloads/Advertising.csv")
  ---&gt; 13 model = train(x,y)
       14 x = data
       15 x_new = 23.0
  
  NameError: name 'x' is not defined
  </code></pre>
  
  <p>I suspect that my mistake is that I am not importing the training set correctly, please tell me how to do it correctly in this case.</p>