title: yaml dump of a pandas dataframe
body: <p>I figured I'd share, since I searched that on SO and couldn't quite find what I needed.</p>
  
  <p>I wanted to dump a <code>pd.DataFrame</code> into a yaml file.</p>
  
  <p><code>Timestamps</code> should be shown nicely, not as the default:</p>
  
  <pre><code>  date: !!python/object/apply:pandas._libs.tslibs.timestamps.Timestamp
    - 1589241600000000000
    - null
    - null
  </code></pre>
  
  <p>Also, the output should be correct YaML format, i.e., it should be readable back by <code>yaml.load</code>. The output should be reasonably concise, i.e. preferring the 'flow' format.</p>
  
  <p>As an example, here is some data:</p>
  
  <pre><code>df = pd.DataFrame([
      dict(
          date=pd.Timestamp.now().normalize() - pd.Timedelta('1 day'),
          x=0,
          b='foo',
          c=[1,2,3,4],
          other_t=pd.Timestamp.now(),
      ),
      dict(
          date=pd.Timestamp.now().normalize(),
          x=1,
          b='bar',
          c=list(range(32)),
          other_t=pd.Timestamp.now(),
      ),
  ]).set_index('date')
  </code></pre>