title: Why doesn't my pd.dataframe see the columns in my csv?
body: <p>I seem to be running into errors when I try to load a CSV file into a dataframe and then do data analysis on it.</p>
  <p>I am running into trouble creating a simple plot using the columns as the data points.</p>
  <p><code>df.{column name}</code> isn't working.</p>
  <p>The code:</p>
  <pre class="lang-py prettyprint-override"><code>import pandas as pd
  
  #column_names = ['area', 'bedrooms', 'age', 'price', 'Unnamed']
  df = pd.read_csv(&quot;testfile.csv&quot;)
  print(df)
  df = df.loc[:, ~df.columns.str.contains('^Unnamed')] # rRemove NAN column
  print(df)
  
  print(df.bedrooms.median())
  </code></pre>
  <p>The error:</p>
  <pre><code>'DataFrame' object has no attribute 'bedrooms'
  </code></pre>
  <p>The CSV file:</p>
  <pre><code>area, bedrooms, age, price,
  2600, 3,        20,  550000,
  3000, 4,        15,  565000,
  3200, 0,        18,  610000,
  3600, 3,        30,  595000,
  4000, 5,        8,   760000,
  </code></pre>