I have a column called Review Text with details like:
Review text
i'm glad i did bc i never would have ordered it/'s
I wrote the following code to replace all the contractions and backslash with empty space and applied it using lambda function. But when I again look at my string I see some forward slash as well and now I can't figure out how to add it inside the replace method because it is not able to take multiple arguments.
def expanded(x):
if type(x) is str:
x = x.replace('\', '')
for key in contractions:
value = contractions[key]
x = x.replace(key, value)
return x
else:
return x
Thanks
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…