in panda dataframe a word frequency is replaced when a rule is defined in a dictionary

Use regex=True:

my_dictionary={'libri':'libro'}
df.Word= df['Word'].replace(my_dictionary, regex=True)

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top