title: How to remove nan's from list of lists?
body: <p>I am trying to remove all the nans from a list of lists and my data is as follows:</p>
  
  <pre><code>[[1,2,3,nan,nan,nan],[4,5,nan],[9,8,7,6,5,4,3,nan,nan,nan,nan,nan]]
  </code></pre>
  
  <p>I've tried doing this from this answer here (<a href="https://stackoverflow.com/q/21773068/10757177">How to delete [NaN] from a list of lists?</a>):</p>
  
  <pre><code>import math
  l = [[1,2,3,np.nan,np.nan,np.nan],[4,5,np.nan],[9,8,7,6,5,4,3,np.nan,np.nan,np.nan,np.nan,np.nan]]
  [xs for xs in l if not any(math.isnan(x) for x in xs)]
  </code></pre>
  
  <p>But it removes the entire list rather than just the nan's</p>