title: 'DataFrame' object has no attribute 'ravel' when transforming target variable?
body: <p>I was fitting a logistic regression with a subset dataset. After splitting the dataset and fitting the model, I got a error message of the following:</p>
  
  <p><code>/Users/Eddie/anaconda/lib/python3.4/site-packages/sklearn/utils/validation.py:526: DataConversionWarning: A column-vector y was passed when a 1d array was expected. Please change the shape of y to (n_samples, ), for example using ravel().
    y = column_or_1d(y, warn=True)</code></p>
  
  <p>So I use <code>target_newrdn = target_newrdn.ravel()</code> to modify my target variable but it gave me this:</p>
  
  <p><code>AttributeError: 'DataFrame' object has no attribute 'ravel'</code></p>
  
  <p>I am wondering what the problem was and how can I fix? Can anyone help, please?</p>
  
  <p>My code:</p>
  
  <pre><code>    from sklearn.datasets import fetch_covtype
      import numpy as np
      import pandas as pd
  
      from sklearn.utils import shuffle
      from sklearn.model_selection import train_test_split
  
      cov = fetch_covtype()
      cov_data = pd.DataFrame(cov.data)
      cov_target = pd.DataFrame(cov.target)
  
      data_newrdn = cov_data.head(n=10000)
      target_newrdn = cov_target.head(n=10000)
  
  
      target_newrdn = target_newrdn.ravel() ## I thought this could fix it??
  
  
      X_train2, X_test2, y_train2, y_test2 = train_test_split(data_newrdn, 
      target_newrdn, random_state=42)
  
      scaler.fit(X_train2)
      X_train_scaled2 = scaler.transform(X_train2)
  
      # Logistic Regression
      param_grid = {'C': [0.001, 0.01, 0.1, 1, 10, 100, 1000]}
      print(param_grid)
      grid = GridSearchCV(LogisticRegression(), param_grid, cv=kfold) 
      grid.fit(X_train_scaled2, y_train2)
      print("Best cross-validation score w/ kfold: 
      {:.2f}".format(grid.best_score_))
      print("Best parameters: ", grid.best_params_)
  </code></pre>