title: Key Error:3 while using For to plot using matplotlib.pyplot.scatter
body: <p>I have a dataset with 10 columns, in which column 4 and 8 are the data I want to plot, and column 9 is determining the marker type.</p>
  
  <pre><code>mkr_dict = {'Fluoride': 'D', 'Chloride': 'P', 'Bromide': 'o', 'Iodide' : '^'}
  for kind in mkr_dict:
      d = df[df.Halogen==kind]
      plt.scatter(d[3], d[7], 
                  s = 20,
                  c = 'red',
                  marker=mkr_dict[kind])
  plt.show()
  </code></pre>
  
  <p>I keep getting Key Error: 3 while executing.
  Can someone give me an advice?</p>