new_contents: import numpy as np
  from sklearn.decomposition import PCA
  import pandas as pd
  import matplotlib.pyplot as plt
  from sklearn.preprocessing import scale
  
  #Load data set
  data = pd.read_csv('PCA_combi.csv')
  
  #convert it to numpy arrays
  X=data.values
  
  #Scaling the values
  X = scale(X)
  
  pca = PCA(n_components=44)
  
  pca.fit(X)
  
  #The amount of variance that each PC explains
  var= pca.explained_variance_ratio_
  
  #Cumulative Variance explains
  var1=np.cumsum(np.round(pca.explained_variance_ratio_, decimals=4)*100)
  
  print var1
  
  plt.plot(var1)
  plt.show()
  
  #Looking at above plot I'm taking 30 variables
  pca = PCA(n_components=30)
  pca.fit(X)
  X1=pca.fit_transform(X)
  
  print X1
  
subject: create PCA_practice.py