title: How to remove characters from floats?
body: <p>I currently have a dataframe that looks as follows:</p>
  
  <pre><code>   Idnumber    Ownership    Date
      1            100        2006
      2            &gt;50        2006 
      1            80         2007
      3            NaN        2006
  </code></pre>
  
  <p>The Ownership column is currently of type float. What I want is to create a groupby function on idnumber that returns the maximum for each Idnumber.
  The problem is that this is not possible with things like > &lt; or ± in there (error: unorderable types: float() >= str()).</p>
  
  <pre><code>  df['Ownership'] = df['Ownership'].astype(str)
    df['Ownership'] = df['Ownership'].map(lambda x: x.strip('± = &gt; + &lt;'))
    df['Ownership'] = df['Ownership'].astype(float).fillna(0.0)
    df['Ownershipadjusted']= df['Ownership'].groupby([df['Idnumber'],df['Ownership']]).max()
  </code></pre>
  
  <p>Will actually not work, since converting it back to float yields an error: could not convert string to float.</p>
  
  <pre><code>         df['Ownership'] = df['Ownership'].apply(pd.to_numeric, errors='coerce')
  </code></pre>
  
  <p>Does not have the required effect either.
  Is there some more direct way to remove symbols from a float, or make this conversion work ?</p>
  
  <p>To avoid confusion, this is what I need:</p>
  
  <pre><code> Idnumber    Ownership    Date      Ownership adjusted
      1            100       2006      100
      2            50        2006       50
      1            80        2007      100
      3            0         2006        0
  </code></pre>
  
  <p>Of course the dataframe contains far more than 4 observations</p>