I have a dataframe where I want to remove occurrences of "XXXX" in any form since my data has the occurrence of this word in many ways. For example my dataframe looks something like this
[ 'XXXX/XXXX/16', '{', '$', '39.00', '}', 'XXXX/XXXX/2016', '.', 'excessive', 'charges', 'would', 'like', 'dispute', '.'] 'XX/XX/XXXX', 'date', 'last', 'payment', ',', 'last', 'payment', 'made', 'XX/XX/XXXX'] ['Collector', 'calls', 'non', 'stop', '.', 'XXXX/XXXX/15' 'Med', 'XXXXXXXX', '{', '$', '290.00', '}', 'XX/XX/XXXX-XX/XX/XXXX']
Desired output should remove all the occurence of "XX" in any form as given above.
The code that I have used here is
stop = ['XXXX', "XX/XX"]
df['issue_detail'] = df['issue_detail'].apply(lambda x: [item for item in x if item not in stop])
The above code is just removing the occurence of "XXXX: from the pandas data frame but how should u remove rest of the XXXX occurrence which are in different forms as above