title: Nested sort, handling of NaN - untouched or sorted according to non-Nan column
body: <p>I have a dataframe, containing NaNs, that I would like to groupby and sort based on two columns. The NaNs should not be on the bottom or top, but be sorted according to the non Nan column.</p>
  
  <pre><code>  Name  Upper  Lower
  0    A   50.0   45.0
  1    B    NaN    2.0
  2    A   30.0    NaN
  3    B   35.0    4.0
  4    A   20.0   15.0
  5    A    NaN   30.0
  
  df.groupby('Name').apply(lambda x: x.sort_values(['Lower','Upper'], ascending=False))
  
         Name  Upper  Lower
  Name                     
  A    0    A   50.0   45.0
       5    A    NaN   30.0
       4    A   20.0   15.0
       2    A   30.0    NaN
  B    3    B   35.0    4.0
       1    B    NaN    2.0
  </code></pre>
  
  <p>What I want is for row 2 and 4 to switch places.</p>
  
  <pre><code>       Name  Upper  Lower
  Name                     
  A    0    A   50.0   45.0
       5    A    NaN   30.0
       2    A   30.0    NaN
       4    A   20.0   15.0
  B    3    B   35.0    4.0
       1    B    NaN    2.0
  </code></pre>
  
  <p>So what I want is to sort on 'Lower' but if it is Nan then on 'Upper', they will never both be Nan for one row. </p>
  
  <p>The bug pydata#3917 would have given me the functionality I want.
  <a href="https://github.com/pandas-dev/pandas/issues/3917" rel="nofollow noreferrer">https://github.com/pandas-dev/pandas/issues/3917</a></p>