How could I title all words except the ones in the list, keep?
keep = ['for', 'any', 'a', 'vs']
df.col
``
0 1. The start for one
1 2. Today's world any
2 3. Today's world vs. yesterday.
Expected Output:
number title
0 1 The Start for One
1 2 Today's World any
2 3 Today's World vs. Yesterday.
I tried
df['col'] = df.col.str.title().mask(~clean['col'].isin(keep))