title: How to downcast numeric columns in Pandas?
body: <p>How to optimize the data frame memory footprint and find the most optimal (minimal) data types <code>dtypes</code> for numeric columns. For example:</p>
  <pre><code>   A        B    C         D
  0  1  1000000  1.1  1.111111
  1  2 -1000000  2.1  2.111111
  
  &gt;&gt;&gt; df.dtypes
  A      int64
  B      int64
  C    float64
  D    float64
  </code></pre>
  <p>Expected result:</p>
  <pre><code>&gt;&gt;&gt; df.dtypes
  A       int8
  B      int32
  C    float32
  D    float32
  dtype: object
  </code></pre>