title: Convert a float column with nan to int pandas
body: <p>I am trying to convert a float pandas column with <code>nans</code> to int format, using apply.
  I would like to use something like this:</p>
  <pre><code>df.col = df.col.apply(to_integer)
  </code></pre>
  <p>where the function <code>to_integer</code> is given by</p>
  <pre><code>def to_integer(x):
      if np.isnan(x):
          return np.NaN
      else:
          return int(x)
  </code></pre>
  <p>However, when I attempt to apply it, the column remains the same.</p>
  <p>How could I achieve this without having to use the standard technique of dtypes?</p>