car_sales[“Price”] = car_sales[“Price”].str.replace(‘[$,]|.d*’, ”).astype(int)
I am trying to convert a price to integer using the code above and it is showing error
car_sales[“Price”] = car_sales[“Price”].str.replace(‘[$,]|.d*’, ”).astype(int)
New contributor
sophie_ttee is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.