How to match a word from column and compare with other column in pandas dataframe
If you know the rules, then you can code them up as you would usually do.
For e.g.
df['Keywords'] == &quot;roll-on&quot; &amp; (df['Type'] == &quot;ball&quot; | df['Type'] == &quot;others&quot;) =&gt; df['Result'] = True
If you have too many rules and associations to manually code, you could consider using a look-up table + merge procedure. Here you would store all the rules and associations as a table (i.e. this would include Keywords, Type, and Result), and merge Result back on to your original dataframe (by Keywords and Type).