Autoconversion of data types in python in a dataframe
Pandas tries to use the right datatype when read the data. However, if, for example, the totalprice column has string, it doesn't make sense for you to convert it to float. You also cannot force pandas to convert it to float, it will just report errors, which is the correct behaviour!
You have to use regex to clean up the string, then you can safely convert the column to float.
I have a DF which has the following Schema :

o_orderkey  ---        int32
o_custkey   ---        int32
o_orderstatus ---      object
o_totalprice  ---      object
o_orderdate  ---       object
o_orderpriority ---    object
o_clerk         ---    object
o_shippriority  ---    int32
o_comment       ---    object

Here the total price is actually a float(Decimals) and the order date is date time.
But on using df.convert_dtypes or df.infer_objects, its not automatically convering them into float/int and  date time.
Is there any way to automatically read and convert the column data type into the correct one? For example in case we do not know the schema of such a data frame beforehand, how would we read and convert the data type to the correct one, without using a regex method to go through every object in the DF.