title: Throw and exception and move on in pandas
body: <p>I have created a pandas dataframe called <code>df</code> with the following code:</p>
  <pre><code>import numpy as np 
  import pandas as pd
  
  ds = {'col1' : [&quot;1&quot;,&quot;2&quot;,&quot;3&quot;,&quot;A&quot;], &quot;col2&quot;: [45,6,7,87], &quot;col3&quot; : [&quot;23&quot;,&quot;4&quot;,&quot;5&quot;,&quot;6&quot;]}
  df = pd.DataFrame(ds)
  </code></pre>
  <p>The dataframe looks like this:</p>
  <pre><code>print(df)
  
    col1  col2 col3
  0    1    45   23
  1    2     6    4
  2    3     7    5
  3    A    87    6
  </code></pre>
  <p>Now, <code>col1</code> and <code>col3</code> are objects:</p>
  <pre><code>print(df.info())
  
   #   Column  Non-Null Count  Dtype 
  ---  ------  --------------  ----- 
   0   col1    4 non-null      object
   1   col2    4 non-null      int64 
   2   col3    4 non-null      object
  </code></pre>
  <p>I want to transform, where possible, the object columns into floats.</p>
  <p>For example, I can convert <code>col3</code> into a float like this:</p>
  <pre><code>df['col3'] = df['col3'].astype(float)
  </code></pre>
  <p>But I cannot convert <code>col1</code> into a float:</p>
  <pre><code>df['col1'] = df['col1'].astype(float)
  
  ValueError: could not convert string to float: 'A'
  </code></pre>
  <p>Is it possible to create a code that converts, where possible, the object columns into float and by-passes the cases in which it is not possible (so, without throwing an error which stops the process)? I guess it has to do with exceptions?</p>