I have a Pandas DataFrame (df) where some of the words contain encoding replacement characters. I want to replace these words with replacement words from a dictionary (translations).
translations = {'gr�nn': 'gronn', 'm�nst': 'menst'}
df = pd.DataFrame(["gr�nn Y", "One gr�nn", "Y m�nst/line X"])
df.replace(translations, regex=True, inplace=True)
However, it doesn't seem to capture all the instances. Current output:
0
0 gronn Y
1 One gr�nn
2 Y m�nst/line X
Do I need to specify any regex patterns to enable the replacement to also capture partial words within a string?
Expected output:
0
0 gronn Y
1 One gronn
2 Y menst/line X