title: How to assign labels and features when uploading a CSV data file into Pandas Dataframe
body: <p>I am loading a CSV file into a Pandas dataframe for a Machine Learning project. I have 16 columns. The "label" or "target" is the last column. The rest are variables. I need to define the first 15 columns as features and the 16th as a target.</p>
  
  <p>All examples I find seem to demonstrate Machine Learning on a set that already has those defined. How can I define my "target" myself?</p>
  
  <pre><code>import pandas as pd   
  import numpy as np    
  import sklearn   
  from sklearn.model_selection import train_test_split
  lymph = pd.read_csv("D:\\dataset_10_lymph.csv", encoding="utf-8", header = 0)
  
  array = lymph.values
  data = array[:,0:-1]
  target = array[:,-1]
  
  X_train, X_test, y_train, y_test = train_test_split(lymph.data, lymph.target, stratify=lymph.target, random_state=66)
  </code></pre>
  
  <p>But when I try to test that my target array is generated properly I get a traceback. </p>
  
  <p>AttributeError: 'DataFrame' object has no attribute 'data'</p>
  
  <p>It seems like it would be a trivial step one would have to take unless they are using a practice sklearn dataset. Any help would be appreciated. Thank you.</p>