title: Using PyYAML to create pandas DataFrame objects - Recursion depth exceeded
body: <p>I am trying to allow the definition of pandas DataFrame objects in a YAML file, I believe this should be possible because DataFrame objects are <a href="http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.to_pickle.html" rel="nofollow">pickleable</a>.</p>
  
  <p>My stripped down YAML file is as follows, saved as 'config.yaml':</p>
  
  <pre><code>!!python/object/new:pandas.DataFrame [[{'dimension1_id':58,'metric1':10},{'dimension1_id':50,'metric':10}]]
  </code></pre>
  
  <p>And I am using the following to load the data into my python script</p>
  
  <pre><code>f = open('config.yaml')
  y = yaml.load(f)
  print y
  </code></pre>
  
  <p>The output (reduced) is as follows:</p>
  
  <pre><code>File "C:\Python27\lib\site-packages\pandas\core\frame.py", line 2085, in __getattr__
  if name in self.columns:
  File "properties.pyx", line 55, in pandas.lib.AxisProperty.__get__ (pandas\lib.c:29240)
  RuntimeError: maximum recursion depth exceeded while calling a Python object
  </code></pre>
  
  <p>I'm using <a href="http://pyyaml.org/wiki/PyYAMLDocumentation#Objects" rel="nofollow">the PyYAML documentation</a> as my only source of information on this.</p>
  
  <p>Can anyone guess why pandas is getting into an infinite loop?</p>
  
  <p>EDIT: Seems like DataFrames objects are not serializable by default, and the extra leg-work looks like more trouble than it is worth. Here is the YAML file that gets created by yaml_serializer from just a simple DataFrame object:</p>
  
  <pre><code>!!python/object/new:pandas.core.frame.DataFrame
  state: !!python/object/new:pandas.core.internals.BlockManager
    state:
    - - !!python/object/apply:numpy.core.multiarray._reconstruct
        args:
        - &amp;id001 !!python/name:pandas.core.index.Index ''
        - [0]
        - b
        state:
        - - 1
          - [!!python/long '2']
          - &amp;id002 !dtype 'object'
          - false
          - [dfsd, id]
        - [null]
      - !!python/object/apply:numpy.core.multiarray._reconstruct
        args:
        - !!python/name:pandas.core.index.Int64Index ''
        - [0]
        - b
        state:
        - - 1
          - [!!python/long '2']
          - !dtype 'int64'
          - false
          - "\0\0\0\0\0\0\0\0\x01\0\0\0\0\0\0\0"
        - [null]
    - - - [!!python/long '23', !!python/long '123']
        - [!!python/long '7', !!python/long '123']
    - - !!python/object/apply:numpy.core.multiarray._reconstruct
        args:
        - *id001
        - [0]
        - b
        state:
        - - 1
          - [!!python/long '2']
          - *id002
          - false
          - [dfsd, id]
        - [null]
  </code></pre>