'B': "{:0<4.0f}" | How should I read this?
<p>While studying <a href="http://pandas.pydata.org/pandas-docs/stable/style.html" rel="nofollow">Pandas Style</a>, I got to the following:</p>

<pre><code>df.style.format("{:.2%}")
</code></pre>

<p>Which I understand means, turn every value to 2 decimal places and add a <code>%</code> in the end.</p>

<p>Just after that, there is:</p>

<pre><code>df.style.format({'B': "{:0&lt;4.0f}", 'D': '{:+.2f}'})
</code></pre>

<p>How should I read <code>'B': "{:0&lt;4.0f}"</code>?</p>

<p>As according to the <a href="http://pandas.pydata.org/pandas-docs/stable/style.html#Finer-Control:-Display-Values" rel="nofollow">Pandas Style documentation</a> you linked to, it's a python <a href="https://docs.python.org/3/library/string.html#format-specification-mini-language" rel="nofollow">format specification string</a>.</p>

<p>The specific options break down to:</p>

<ul>
<li><code>0&lt;</code> Forces the field to be left-aligned within the available space, and pads with zeros</li>
<li><code>4</code> Specifies the width of the field</li>
<li><code>.0</code> Specifies the precision of the number, i.e. how many decimal points should be displayed</li>
<li><code>f</code> Displays the number as a fixed-point number.</li>
</ul>

python python-2.7 pandas