I have this df, where 'escalacoes' values are currently as type str:
apelido escalacoes
0 Keno 2.868.755
1 Pedro 2.483.069
2 Bruno Henrique 1.686.894
3 Hugo Souza 809.186
4 Guilherme Arana 1.314.769
5 Filipe Luís 776.147
6 Thiago Galhardo 2.696.853
7 Vinícius 1.405.012
8 Nenê 1.369.209
9 Jorge Sampaoli 1.255.731
10 Réver 1.505.522
11 Víctor Cuesta 1.220.451
Now I'm trying to convert those string values to numeric and then sort them. I'm trying:
df.escalacoes = pd.to_numeric(df.escalacoes, errors='coerce')
df = df.sort_values('escalacoes', ascending=False).reset_index(drop=True).copy()
But I'm getting:
0 Hugo Souza 809.186
1 Filipe Luís 776.147
2 Keno NaN
3 Pedro NaN
4 Bruno Henrique NaN
5 Guilherme Arana NaN
6 Thiago Galhardo NaN
7 Vinícius NaN
8 Nenê NaN
9 Jorge Sampaoli NaN
10 Réver NaN
11 Víctor Cuesta NaN
Apparently, pandas does not know how to convert string numbers in the millions to numeric.
How do I achieve this?