I am fairly new to Python so forgive me this simple question. I'm trying to convert string to float. Here is a sample of the data:
0 10.65%
1 7.90%
When I try:
df['int_rate'] = df['int_rate'].astype('float')
I get:
ValueError: could not convert string to float: '13.75%'
When I try:
df['int_rate'] = df['int_rate'].replace("%","", inplace=True)
And check my data, I get:
0 None
1 None
Any ideas what I'm doing wrong? Many thanks!