title: Python Good Integration of Pandas Dataframe in Overall Class Design
body: <p>I have a very short question regarding class design. My program uses a <code>Data</code> class to load various <code>pandas dataframes</code> as class attributes. There are also some getter methods. Additionally, I have another class which uses the data (approx. 150 MB) provided from the <code>Data</code> class as a class attribute. The <code>Foobar_Collection</code> class needs only one instance since it's job is to keep track of all <code>Foo</code> instances. Conceptually, it looks like this:</p>
  
  <pre><code>class Data(object):
     def __init__(self):
        self.x = [1,2,3,4] #actually load a pandas dataframe here
     def getX(self,i):
        return self.x[i]
  
  class Foobar_Collection(dict):
      data = Data()                                #### Is this okay? 
      def __init__(self, *arg, **kw):
          super(Foobar_Collection, self).__init__(*arg,**kw)
      def foobar(self,*arg,**kw):
          foo = Foo(*arg,**kw)
          self[foo.name] = foo
          return foo
      def run_myMethodForAllfoobars(self):
          for name in self:
              self[name].myMethod(10)
          return None  
  
  class Foo(object):
      def __init__(self,name):
          self.name = name
          self.num  = None
      def myMethod(self,i):
          self.num = Foobar_Collection.data.getX(i) #### Is this okay?
          return None 
  
  #just to illustrate the purpose of Foobar_Collection                                                             
  Foobar = Foobar_Collection()
  Foobar.foobar('A')
  Foobar.foobar('B') 
  </code></pre>
  
  <p>It's working fine. I just wonder wether this is a good way "to integrate" the data? I would appreciate some comments about this design. </p>