title: df.to_csv formatting in python
body: <p>I have a dataframe of some float datatype column and 2 date type column.Sample</p>
  
  <pre><code> I    J    P          V  
  1.2   11  2011-12-03  2015-08-07 19:14:07
  1.0   18  2011-12-03  2015-08-07 19:14:07
  1.8   21  2011-12-03  2015-08-07 19:14:07
  </code></pre>
  
  <p>Now i want I and J col should be formatted yo .4f (after decimal 4 places).So 1.2 should reflect as 1.2000, In J col 18 should reflect as 18.0000.
  And date field should be formatted to YYYY-MM-DD for P and YYYY-MM-DD HH:MM:SS.</p>
  
  <p>Yes it looks fine in dateframe..i formatted the I &amp; J column by</p>
  
  <pre><code>df['I'] = ['%.4f'%x for x in df['I']]
  df['J'] = ['%.4f'%x for x in df['J']]
   ## 1.2000, 11.0000  # fine
  </code></pre>
  
  <p>Then tried to give a csv output, But in that again 1.2000 reflected as 1.2 and 11.0000 as 11,,,, And  date become 03/12/2011,07/08/2015 19:14:07  respectively for first row date value in dataframe.</p>
  
  <p>Which is not fullfilling the requirement(4 decimal place and date as YYYY_MM_DD).</p>
  
  <p>I tried doing </p>
  
  <pre><code> df['P'] = [x.strftime('%Y-%m-%d') for x in df['P']]
   df['V'] = [x.strftime('%Y-%m-%d %H:%M:%S') for x in df['V']]
   #Then from doc and google tried doing 
   df.to_csv('D:/New.csv',date_format='%Y-%m-%d %H:%M:%S',index=False)  ### not worked
   df.to_csv('D:/changed_2.csv',float_format='string',date_format='%Y-%m-%d %H:%M:%S',index=False)   ###Also not Working
  </code></pre>
  
  <p>Please suggest how can i give a csv file with this requirement.</p>