title: How to fix Value Error with train_test_split in Python Numpy
body: <p>I am using sklearn with a numpy array.
  I have 2 arrays (x, y) and they should be:</p>
  
  <pre><code>test_size=0.2
  train_size=0.8
  </code></pre>
  
  <p>This is my current code:</p>
  
  <pre><code>def predict():
  
      sample_data = pd.read_csv("includes\\csv.csv")
  
      x = np.array(sample_data["day"])
      y = np.array(sample_data["balance"])
  
  
      x = x.reshape(1, -1)
  
  
  
      y = y.reshape(1, -1)
  
  
  
  
      print(x)
      print(y)
  
  
  
      X_train, X_test, y_train, y_test = train_test_split(x, y, test_size=0.2)
  
  
  
      clf = LinearRegression()
      clf.fit(x_train, y_train)
  
      clf.score(x_test, y_test)
  
  </code></pre>
  
  <p>The error is:</p>
  
  <pre><code>ValueError: With n_samples=1, test_size=0.2 and train_size=None, the resulting train set will be empty. Adjust any of the aforementioned parameters.
  </code></pre>
  
  <p>, and it appears in the line:</p>
  
  <pre><code>X_train, X_test, y_train, y_test = train_test_split(x, y, test_size=0.2)
  </code></pre>
  
  <p>Any ideas why that appears?</p>