I am trying to replace all columns in my df with prices to ints however for some reason the replace() method isn't working:
df = pd.read_csv(f_name, dtype="string")
df = df[df.columns.dropna()]
df[cols_int] = df[cols_int].replace({"[\$]": "", "[,]": ""}, regex=True)
df[cols_int] = df[cols_int].astype(int)
Error:
ValueError: invalid literal for int() with base 10: '$499,000'
I'd appreciate any help!
df[cols_int].str.replace({"[\$]": "", "[,]": ""}, regex=True)-> place.str.in between.