replace '?' with Nan or zero
<p>I have one coluknn of my data which is:</p>

<pre><code>Power:
0     130
1     165
2     150
3     150
4     ?
5     198
6     220
7     215
8     225
9     ?
10    170
</code></pre>

<p>and I want to replace every '?' with Nan or zero.</p>

<p>I tried:</p>

<pre><code>data['Power'].str.replace('?', 0).astype(float)
data['Power'].str.replace('^[^\d]*', '').astype(float)
data['Power'].replace(r'\s+', np.nan, regex=True)
data['Power'].convert_objects(convert_numeric=True)
data['Power'].replace(regex=True,inplace=True,to_replace=r'\D',value=r'')
</code></pre>

<p>but none of these works!</p>

<p>Some produce an error <code>could not convert string to float</code> and some didn't produce any errors but did not change the '?'.</p>