I have a dataframe which contains a column of strings of float values (negative and positive float values) in the format .000 (3dp). This number is represented as a string in Column1 and I would like to add a column2 to the DataFrame as a float and convert the string representation of the float value to a float value preserving the 3 dp. I have had problems trying to do this and have error message of "ValueError: could not convert string to float:" Grateful for any help
Code
dataframe4['column2'] = ''
dataframe4['column2']=dataframe4['column1'].astype('float64')
#Round column1, column2 float columns to 3 decimal places
dataframe4.round({'column1': 3, 'column2': 3})