title: I only the first row of train_X and first value of train_y to train the SVM model...but the error I get is ''bad input shape ()''
body: <p>I have the following code and the error in Python: 
  I want only the first row of <code>train_X</code> and first value of t<code>rain_y</code> to train the SVM model...
  (I want to train the model on data sequentially by extracting the data from Iris data set one by one)</p>
  
  <p>CODE:</p>
  
  <pre><code>np.random.seed(1)
  
  iris = pd.read_csv("Iris.csv")
  iris.drop("Id", axis=1, inplace = True)
  iris = iris.values
  
  train, test = train_test_split(iris, test_size=0.3) # our main data split 
  into train and test
  
  i=0
  train_X1 = train_X[i:i+1,:]
  train_y1 = train_y[i]     
  
  model = svm.SVC() # select the svm algorithm
  
  # we train the algorithm with training data and training output
  model.fit(train_X1, train_y1)
  
  # we pass the testing data to the stored algorithm to predict the outcome
  prediction = model.predict(test_X)
  print('The test accuracy of the SVM is :', 
  metrics.accuracy_score(prediction,test_y)) 
  # we check the accuracy of the algorithm
  </code></pre>
  
  <p>ERROR:</p>
  
  <blockquote>
    <p>ValueError Traceback (most recent call last)</p>
    
    <p> in ()</p>
    
    <p>8 # we train the algorithm with training data and training output
    ----> 9 model.fit(train_X1, train_y1)</p>
  
  <pre><code> 147         self._sparse = sparse and not callable(self.kernel)   
  </code></pre>
    
    <p>--> 149         X, y = check_X_y(X, y, dtype=np.float64, order='C', accept_sparse='csr') 150         y = self._validate_targets(y)</p>
  
  <pre><code> 545                         dtype=None) 546     else:
  </code></pre>
    
    <p>--> 547         y = column_or_1d(y, warn=True) 548         _assert_all_finite(y) 549     if y_numeric and y.dtype.kind == 'O':</p>
  
  <pre><code> 581         return np.ravel(y)
  </code></pre>
    
    <p>--> 583     raise ValueError("bad input shape {0}".format(shape))
             ValueError: bad input shape ()</p>
  </blockquote>