Baobab1988
Baobab1988

Reputation: 715

How to remove unwanted characters (brackets) from pandas data frame?

One of the column values in my csv file contains unwanted characters ("'). I've tried to remove them by using the below method, but it won't let me:

df= df.replace({'"'':''}, regex=True)

Could someone please help me with this? Thank you in advance.

Upvotes: 0

Views: 75

Answers (1)

BENY
BENY

Reputation: 323396

Try remove them one by one

df = df.replace({'"':''}, regex=True).replace({"'":''}, regex=True)

Upvotes: 1

Related Questions