title: TypeError: 'type' object has no attribute '__getitem__'
body: <p>I keep getting an error when trying to run the <code>rmakeprofile</code> command. I get an error saying that 'type' object has no attribute '__getitem__'.</p>
  
  <pre><code>from array import array
  from ROOT import gROOT, TCanvas, TProfile, TGraph
  
  class Data(object):
      def __init__(self, s):
          self.p = TProfile()
          self.data = []
          for line in s:
              if not line.startswith("#"):    #Removes Commented lines
                  columns = line.split(',')   #Splits into Columns
                  if columns:
                      datum = {
                            "threshold" : float(columns[1]),
                            "count" : float(columns[2]),
                            "rate" : float(columns[2]) /float(columns[0]),
                            "scantime" : float(columns[0])
                            }
                      self.data.append(datum)
                      print columns[1], float(columns[2])/float(columns[0])
  
      def rmakeprofile(self, data, xval, yval, noBins):
          self.a = array('d')
          for datum in data:
              self.a.append(float(datum[xval]))
          self.p = TProfile('p','',noBins,min(self.a),max(self.a))
          for datum in  data:
              self.p.Fill(datum[xval],datum[yval])
          return self.p
  </code></pre>
  
  <p>Here is the traceback:</p>
  
  <pre><code>p = d.rmakeprofile(data,"threshold","rate",13)
  
  Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
  File "ray.py", line 27, in rmakeprofile
  self.a = array('d')
  TypeError: 'type' object has no attribute '__getitem__'
  </code></pre>