df = pd.DataFrame({'Product':['Umbrella,handlX', 'Matress', 'Badminton,shuttlX', 'Shuttle'], })
Product
0 Umbrella,handlX
1 MatrXss
2 Badminton,shuttlX
3 Shuttle
search for "X" and if found replace it with e using user defined function.
Output as given below:
Product
0 Umbrella,handle
1 Matress
2 Badminton,shuttle
3 Shuttle