title: Pandas DataFrame Float Formatting
body: <p>I have a Pandas DataFrame of survey responses that I'm aggregating to averaged scores and outputting to HTML. My current code looks like this:</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  df = pd.read_csv('survey_scores.csv', header=0)
  np.round(pd.DataFrame(df.groupby('question_number').aggregate('mean').score).transpose(), 2).to_html()
  </code></pre>
  
  <p>It takes a DataFrame that looks kinda like this in csv...</p>
  
  <pre><code>response_number, question_number, score
  1, 1, 3.0
  1, 2, 4.0
  1, 3, 4.0
  2, 1, 4.0
  2, 2, 4.0
  2, 3, 1.0
  </code></pre>
  
  <p>And it outputs the averaged scores to an HTML table that formats the score values like this:</p>
  
  <pre><code>3.5, 4, 2.5
  </code></pre>
  
  <p>However, I'm trying to get the output to force each number to display two digits after the decimal point. I got it to round to two decimal points, but I'm having difficulty getting my output to format the values like this:</p>
  
  <pre><code>3.50, 4.00, 2.50
  </code></pre>
  
  <p>How can I get these values formatted to two decimal places?</p>