title: python-polars casting string to numeric
body: <p>When applying pandas.to_numeric,Pandas return dtype is float64 or int64 depending on the data supplied.<a href="https://pandas.pydata.org/docs/reference/api/pandas.to_numeric.html" rel="nofollow noreferrer">https://pandas.pydata.org/docs/reference/api/pandas.to_numeric.html</a></p>
  <p>is there an equivelent to do this in polars?</p>
  <p>I have seen this <a href="https://stackoverflow.com/questions/71441375/how-to-cast-a-column-with-data-type-listnull-to-listi64-in-polars">How to cast a column with data type List[null] to List[i64] in polars</a> however dont want to  individually cast each column. got couple of string columns i want to turn numeric. this could be int or float values</p>
  <pre><code>#code to show casting in pandas.to_numeric
  import pandas as pd
  df = pd.DataFrame({&quot;col1&quot;:[&quot;1&quot;,&quot;2&quot;], &quot;col2&quot;:[&quot;3.5&quot;, &quot;4.6&quot;]})
  print(&quot;DataFrame:&quot;)
  print(df)
  df[[&quot;col1&quot;,&quot;col2&quot;]]=df[[&quot;col1&quot;,&quot;col2&quot;]].apply(pd.to_numeric)
  print(df.dtypes)
  </code></pre>