title: Issue retrieving key error not in index for reading from csv file for plotting
body: <p>Using below code to generate a stackedbar line graph however plotting the graph throws error. I tried to figure out the issue but could not. I checked csv file has row name Cat1 but still it throws error.</p>
  <p>Code</p>
  <pre><code> xtick=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]
   data = pd.read_csv(&quot;C:/Graphs/data.csv&quot;)
   data[['Cat1','Cat2','Cat3']].plot(kind='bar', width = width,stacked=True,color=colors,figsize=(6.5, 
    3))
  plt.ylabel(&quot;Latency (ms)&quot;)
  plt.ylim(0, 75000)
  data['Output_data'].plot(secondary_y=True,color='darkslategrey',marker='o',MarkerSize=2)
  ax = plt.gca()
  plt.xlim([-width, len(data['Cat3'])-width])
  plt.ylim(0, 6)
  plt.ylabel(&quot;Output-data&quot;)
  </code></pre>
  <p>data.csv file</p>
  <pre><code>Cat1    Cat2    Cat3    Output_data
  12.97   699.52  230 12.545
  38.99666667 673.4933333 5010    12.545
  110.73  601.76  5010    3.137
  134.5966667 577.8933333 1250    6.273
  165.69  546.8   2500    6.273
  </code></pre>
  <p>Error</p>
  <pre><code>   data[['Cat1','Cat2','Cat3']].plot(kind='bar', width = width,stacked=True,color=colors,figsize=(6.5, 3))
     KeyError: &quot;['Cat1'] not in index&quot;
  </code></pre>