Convert object to float number - NaN

Viewed 66

I have a table with several columns where the numbers appear as objects. I would like to convert an object with this format "[0.015158]" to a float number "0.015158"

My code is:

coeff_dfethapoly['Slope (b)_d1']= pd.to_numeric(coeff_dfethapoly['Slope (b)_d1'], errors = 'coerce')

This code does not work and the result is 'NaN'.

0 Answers
Related