title: How to extract numbers from a list of strings?
body: <p>How should I extract numbers only from </p>
  
  <pre><code>a = ['1 2 3', '4 5 6', 'invalid']
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>mynewlist = [s for s in a if s.isdigit()]
  print mynewlist
  </code></pre>
  
  <p>and </p>
  
  <pre><code>for strn in a:
      values = map(float, strn.split())
  print values
  </code></pre>
  
  <p>Both failed because there is a space between the numbers.</p>
  
  <p>Note: I am trying to achieve output as:</p>
  
  <pre><code>[1, 2, 3, 4, 5, 6]
  </code></pre>