title: How to select all non-NaN columns and non-NaN last column using pandas?
body: <p>Forgive me if the title a little bit confusing.</p>
  
  <p>Assuming I have <code>test.h5</code>. Below is the result of reading this file using <code>df.read_hdf('test.h5', 'testdata')</code></p>
  
  <pre><code>     0     1     2     3     4     5    6
  0   123   444   111   321   NaN   NaN  NaN
  1   12    234   113   67    21    32   900
  3   212   112   543   321   45    NaN  NaN
  </code></pre>
  
  <p>I want to select the last non-Nan column. My expected result is like this</p>
  
  <pre><code>0   321
  1   900
  2   45
  </code></pre>
  
  <p>Also I want to select all column except the last non-NaN column. My expected result perhaps is like this. It might can be in numpy array but I have not foud any solution yet.</p>
  
  <pre><code>      0     1     2     3     4     5    6
  0    123   444   111   
  1    12    234   113   67    21    32  
  3    212   112   543   321  
  </code></pre>
  
  <p>I searched online and found <code>df.iloc[:, :-1]</code> for reading all column but the last one and <code>df.iloc[:, -1]</code> for reading the last column.</p>
  
  <p>My current result using these 2 command is like this:
  1. for reading all column except the last one</p>
  
  <pre><code>       0     1     2     3     4     5    
  0     123   444   111   321   NaN   NaN  
  1     12    234   113   67    21    32   
  3     212   112   543   321   45    NaN  
  </code></pre>
  
  <p>2.for reading the last column</p>
  
  <pre><code>0   NaN
  1   900
  2   Nan
  </code></pre>
  
  <p>My question is, is there any command or query used in pandas to address these condition?</p>
  
  <p>Thank you for any help and suggestion.</p>