title: How to fix error with train_test_split in Python?
body: <pre><code>from sklearn.model_selection import train_test_split
  from sklearn.neighbors import KNeighborsClassifier
  import numpy as np
  import pandas as pd
  import matplotlib.pyplot as plt
  x=np.array([0.1,0.2,0.7,8.0,45.0,56.0,66.0,0.7,0.6,64.0])
  y=np.array([0,0,0,1,1,1,1,0,0,1])
  x = np.array(x).reshape((1, -1))
  y = np.array(y).reshape((1, -1))
  x_train, x_test, y_train, y_test = train_test_split(x, y,test_size=0.4,         train_size=0.5, random_state=7, stratify=y)
  knn = KNeighborsClassifier()
  knn.fit(y_train, x_train)
  y_train_predict = knn.predict(x_train)
  y_test_predict = knn.predict(x_test)
  print(y_train_predict)
  print(y_test_predict)
  </code></pre>
  
  <p>Error:</p>
  
  <blockquote>
    <p>With n_samples=1, test_size=0.4 and train_size=0.5, the resulting train set will be empty. Adjust any of the aforementioned parameters.</p>
  </blockquote>