Any tips on how to see if a certain word is inside pandas column?
# initialise data of lists.
data = {'Colour':['Blue andtext', 'Greys', 'Potato', 'Yellow','Tree'],
'Values':[20, 21, 19, 18,44]}
df2 = pd.DataFrame(data)
Let's say:
colours = ['Blue','Grey','Yellow']
How do I check if df2['Colour'] is actually a colour and represent it in a new column?
Output should be
Colour Value Actualcolour
Blue andtext 20 Blue
Greys 21 Grey
Potato 19 NaN
Yellow 18 Yellow
Tree 44 Nan