I'm trying to understand how to make my code more concise. I have the following statement which works fine:
cleaned = dc_listings['price'].str.replace(',', '').str.replace('$', '')
However, when I try using a regex, as in the below, it does not work:
cleaned = dc_listings['price'].str.replace(',|$', '')
The cleaned variable still contains some '$' entries... What am I doing wrong?
Thanks!