title: KeyError: "['petal length'] not in index"
body: <p>I'm having some issues with the index from a Pandas data frame. What I'm trying to do is load data from a csv file, create a Pandas data frame and then select specific columns from that data frame and convert it in to an array. </p>
  
  <blockquote>
    <p><em>KeyError: "['petal length'] not in index"</em></p>
  </blockquote>
  
  <p>The code I'm using is</p>
  
  <pre><code>  import pandas as pd
    import numpy as np
    data = pd.read_csv('iris.csv')
    x = np.array(data[['sepal length', 'petal length']])
  </code></pre>
  
  <p>This is the table:</p>
  
  <p><img src="https://i.stack.imgur.com/1mKl0.png" alt="Pandas Data Frame"></p>
  
  <p>Using <code>reindex</code> will create missing values for the columns. </p>
  
  <p>Thanks for helping out!</p>