I am working with a pandas dataframe of football players. There is a column with the value of each player. The problem is the type of this column is an object and I want to convert it to float64. How can I do it? The variable is Release clause.
df_fifa['Release Clause']
0 €226.5M
1 €127.1M
2 €228.1M
3 €138.6M
4 €196.4M
...
18202 €143K
18203 €113K
18204 €165K
18205 €143K
18206 €165K
Name: Release Clause, Length: 18207, dtype: object
I want to convert it to the complete number. E.g. €200M to 200.000.000 and €200k to 200.000.
I know the funcion should be
df_fifa['Release Clause'].astype(str).astype(int)
But first I should remove €, M & k. I tried this for removing but it didn't work
df_fifa['Release Clause'] = df_fifa['Release Clause'].replace("€","")
Anyone knows how to do it?
Thank you!