title: add column to data set in python
body: <p>I am trying to add predicted data back to my original dataset in Python. I think I'm supposed to use Pandas and ASSIGN and pd.DataFrame but I have no clue how to write this after reading all the documentation (sorry I'm new to all this and just started learning coding recently). I've written my code below and just need help with the code for adding my predictions back to the dataset. Thanks for the help!</p>
  
  <pre><code># Importing the libraries
  import numpy as np
  import matplotlib.pyplot as plt
  import pandas as pd
  
  # Importing the dataset
  dataset = pd.read_csv('Social_Network_Ads.csv')
  X = dataset.iloc[:, [2, 3]].values
  y = dataset.iloc[:, 4].values
  
  # Splitting the dataset into the Training set and Test set
  from sklearn.cross_validation import train_test_split
  X_train, X_test, y_train, y_test = train_test_split(X, y, test_size = 0.25,     
  random_state = 0)
  
  # Feature Scaling X_train and X_test
  from sklearn.preprocessing import StandardScaler
  sc = StandardScaler()
  X_train = sc.fit_transform(X_train)
  X_test = sc.transform(X_test)
  
  #Feature scaling the all independent variables used to build the model
  whole_dataset = sc.transform(X)
  
  # Fitting classifier to the Training set
  # Create your Naive Bayes here
  from sklearn.naive_bayes import GaussianNB
  classifier = GaussianNB()
  classifier.fit(X_train, y_train)
  
  # Predicting the Test set results
  y_pred = classifier.predict_proba(X_test)
  
  # Predicting the results for the whole dataset
  y_pred2 = classifier.predict_proba(whole_dataset) 
  
  # Add y_pred2 predictions back to the dataset
  ???
  </code></pre>