title: Pandas: Remove NaN only at beginning and end of dataframe
body: <p>I've got a pandas DataFrame that looks like this:</p>
  
  <pre><code>       sum
  1948   NaN
  1949   NaN
  1950     5
  1951     3
  1952   NaN
  1953     4
  1954     8
  1955   NaN
  </code></pre>
  
  <p>and I would like to cut off the <code>NaN</code>s at the beginning and at the end ONLY (i.e. only the values incl. <code>NaN</code> from 1950 to 1954 should remain).
  I already tried <code>.isnull()</code> and <code>dropna()</code>, but somehow I couldn't find a proper solution.
  Can anyone help?</p>