python pandas remove non numeric characters from multiple columns

Solutions on MaxInterview for python pandas remove non numeric characters from multiple columns by the best coders in the world

showing results for - "python pandas remove non numeric characters from multiple columns"
Valeria
29 Jun 2017
1# Convert multiple columns to float when they contain non-numeric characters e.g. "R 5 000.00" -> 5000.00
2df[['A','B','C','D']] = df[['A','B','C','D']].replace(regex=[r'\D+'], value="").astype(float)