I have a list of suffixes I want to remove in a list, say suffixes = ['inc','co','ltd'].
I want to remove these from a column in a Pandas dataframe, and I have been doing this:
df['name'] = df['name'].str.replace('|'.join(suffixes), '').
This works, but I do NOT want to remove the suffice if what remains is numeric. For example, if the name is 123 inc, I don't want to strip the 'inc'. Is there a way to add this condition in the code?