title: Memoize a costly computation of a data frame
body: <p>I have a costly computation, running on pandas <code>DataFrames</code>. I'd like to memoize it. I'm trying to figure out, what I can use for this.</p>
  
  <pre><code>In [16]: id(pd.DataFrame({1: [1,2,3]}))
  Out[16]: 52015696
  
  In [17]: id(pd.DataFrame({1: [1,2,3]}))
  Out[17]: 52015504
  
  In [18]: id(pd.DataFrame({1: [1,2,3]}))
  Out[18]: 52015504
  
  In [19]: id(pd.DataFrame({1: [1,2,3]})) # different results, won't work for my case
  Out[19]: 52015440
  
  In [20]: hash(pd.DataFrame({1: [1,2,3]})) # throws
  ---------------------------------------------------------------------------
  TypeError                                 Traceback (most recent call last)
  &lt;ipython-input-20-3bddc0b20163&gt; in &lt;module&gt;()
  ----&gt; 1 hash(pd.DataFrame({1: [1,2,3]}))
  
  /usr/local/lib/python2.7/dist-packages/pandas/core/generic.pyc in __hash__(self)
       52     def __hash__(self):
       53         raise TypeError('{0!r} objects are mutable, thus they cannot be'
  ---&gt; 54                               ' hashed'.format(self.__class__.__name__))
       55 
       56     def __unicode__(self):
  
  TypeError: 'DataFrame' objects are mutable, thus they cannot be hashed
  </code></pre>
  
  <p>Is it possible to do what I want, given that I'm sure that I'm not mutating the <code>DataFrame</code> that gets memoized?</p>