I am having a "car_sales" pandas dataframe which looks as below:
Make Colour Odometer (KM) Doors Price
0 Toyota White 150043 4 $4,000
1 Honda Red 87899 4 $5,000
2 Toyota Blue 32549 3 $7,000
3 BMW Black 11179 5 $22,000
4 Nissan White 213095 4 $3,500
5 Toyota Green 99213 4 $4,500
6 Honda Blue 45698 4 $7,500
7 Honda Blue 54738 4 $7,000
8 Toyota White 60000 4 $6,250
9 Nissan White 31600 4 $9,700
I want to remove $ and , in the Price column.
For example, $4,000 should become 4000.
I have written the below code:
car_sales['Price'] = car_sales['Price'].str.replace('[\$, \,]', '')
But, 'jupyter notebook' is throwing an error:
FutureWarning: The default value of regex will change from True to False in a future version.
car_sales['Price'] = car_sales['Price'].str.replace('[\$, \,]', '')