I have an object column(item_price) and I want to convert it in a float column but I can´t not do it with the symbol $...can anyone help me??
Thanks in advance
CodePudding user response:
Use:
chipo['item_price'] = chipo['item_price'].str.lstrip('$')
and then convert it float.
CodePudding user response:
Try this:
chipo['item_price'] = chipo['item_price'].str.replace('$', '', regex=False).astype(float)