title: kNN classification using scikit-learn: TypeError: unsupported operand type(s) for /: 'str' and 'int'
body: <p>I am trying to predict the name of attribute <code>area</code> which has <code>object</code> as its <code>dtype</code> using <code>longitude</code> and <code>latitude</code> having <code>float</code> as their <code>dtype</code>. I am using kNN algorithm but I am getting this error: <code>TypeError: unsupported operand type(s) for /: 'str' and 'int'</code></p>
  
  <p>I am confused about the data types in the use of kNN. Could I get any help with understanding what I am doing wrong here? Here's my code:</p>
  
  <pre><code>from sklearn.neighbors import KNeighborsClassifier, KNeighborsRegressor
  
  # read csv file
  
  df = pd.read_csv("perfectData.csv")
  X = np.array(df.ix[:, 13:])
  y = np.array(df['area'])
  
  X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3, random_state=90)
  y_train=y_train.ravel()
  y_test=y_test.ravel()
  
  knn = KNeighborsRegressor(n_neighbors=3)
  
  # fitting the model
  knn.fit(X_train, y_train)
  
  # predict the response
  pred = knn.predict(X_test)
  
  print(pred)
  </code></pre>