title: Pandas float16 conversion
body: <p>Im trying to optimise my df dtypes to consume less memory. </p>
  
  <p>I came out with the following solution for floats:</p>
  
  <pre><code>@staticmethod
  def optimize_float(series):
      low_consumption = series.astype('float16')
      if any(low_consumption.isin([np.inf])):
          medium_consumption = series.astype('float32')
          if any(medium_consumption.isin([np.inf])):
              return series.astype('float64')
          return medium_consumption
      return low_consumption
  </code></pre>
  
  <p>I came across a weird use case as follows: </p>
  
  <pre><code>In[89]: df = pd.DataFrame({'a':[11111,22222,3333]})
  In[90]: df
  Out[90]: 
         a
  0  11111
  1  22222
  2   3333
  In[91]: df.astype('float16')
  Out[91]: 
           a
  0  11112.0
  1  22224.0
  2   3332.0
  In[92]: df.astype('float32')
  Out[92]: 
           a
  0  11111.0
  1  22222.0
  2   3333.0
  </code></pre>
  
  <p>when converting to <code>float16</code> it rounded up\changed the values in my series, while I expected it to put <code>inf</code> or throw an error if it cant convert that to the dtype I passed through. </p>
  
  <p>I also noticed differences in the describe() method output on that df: </p>
  
  <pre><code>In[83]: df = pd.DataFrame({'a':[11111,22222,3333]})
  In[84]: df['a'].describe()
  Out[84]: 
  count        3.000000
  mean     12222.000000
  std       9493.383011
  min       3333.000000
  25%       7222.000000
  50%      11111.000000
  75%      16666.500000
  max      22222.000000
  Name: a, dtype: float64
  In[85]: df['a'].astype('float16').describe()
  Out[85]: 
  count    3.000000e+00
  mean     1.222400e+04
  std               inf
  min      3.332000e+03
  25%      7.222000e+03
  50%      1.111200e+04
  75%      1.666800e+04
  max      2.222400e+04
  Name: a, dtype: float64
  </code></pre>
  
  <p>How can I convert my series to the lowest consuming memory type without loosing\altering any data? </p>
  
  <p>where did my logic in the <code>optimize_float</code> function fails?</p>