Pandas remove rows which any string
<p>A very basic qs guys - thans vm for taking a look. I want to remove rows in <code>Col1</code> which contain any string - care about only numeric values in <code>Col1</code>.</p>

<p>Input:</p>

<pre><code>      Col1  Col2 Col3
0      123  48.0  ABC
1       45  85.0  DEF
2    A.789  66.0  PQR
3    RN.35   9.0  PQR
4      LMO  12.0  ABC
</code></pre>

<p>Output:</p>

<pre><code>      Col1  Col2 Col3
0    123.0  48.0  ABC
1     45.0  85.0  DEF
</code></pre>

<p>I tried </p>

<pre><code>test = input_[input_['Col1'].str.contains(r'ABCDEGGHIJKLMNOPQRSTUVWXYZ.')]
</code></pre>

<p>But see this error</p>

<blockquote>
  <p>ValueError: cannot index with vector containing NA / NaN values</p>
</blockquote>

<p>Could you:</p>

<ul>
<li>Give a short explanation as to why that's not working?</li>
<li>What would be the alternate solution pls?</li>
</ul>

<p>do like this:</p>

<pre><code>import re
regex = re.compile("[a-zA-Z]+")
df.ix[df.col1.map(lambda x: regex.search(x) is None)]
</code></pre>

python string pandas indexing numeric