title: Error in copying a composite object consisting mostly of pandas.DataFrame
body: <p>I try to use <strong>composition</strong> with pandas.DataFrame in the following way, but it is giving me errors when I try to copy the object. </p>
  
  <pre><code>import numpy as np
  import pandas as pd
  import copy
  
  
  class Foo(object):
      """
      Foo is composed mostly of a pd.DataFrame, and behaves like it too. 
      """
  
      def __init__(self, df, attr_custom):
          self._ = df
          self.attr_custom = attr_custom
  
      # the following code allows Foo objects to behave like pd.DataFame,
      # and I want to keep this behavior.
      def __getattr__(self, attr):
          return getattr(self._, attr)
  
  
  df = pd.DataFrame(np.random.randint(0,2,(3,2)), columns=['A','B'])
  foo = Foo(df)
  foo_cp = copy.deepcopy(foo)
  </code></pre>
  
  <p>The error I get:</p>
  
  <pre><code>---&gt; 16 foo_cp = copy.deepcopy(foo)
  
  /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.pyc in deepcopy(x, memo, _nil)
      188                             raise Error(
      189                                 "un(deep)copyable object of type %s" % cls)
  --&gt; 190                 y = _reconstruct(x, rv, 1, memo)
      191 
      192     memo[d] = y
  
  /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/copy.pyc in _reconstruct(x, info, deep, memo)
      341                 slotstate = None
      342             if state is not None:
  --&gt; 343                 y.__dict__.update(state)
      344             if slotstate is not None:
      345                 for key, value in slotstate.iteritems():
  
  TypeError: 'BlockManager' object is not iterable 
  </code></pre>
  
  <p>My questions:  </p>
  
  <ol>
  <li>Any idea what is going on here?  </li>
  <li>What is the "recommended" way of using composition with pandas.DataFrame?  </li>
  <li>If for some reasons it is a bad idea to use <code>_</code> as the name of the dummy attribute, please let me know.</li>
  </ol>