I have this Pandas dataframe (df):
A B 0 1 green 1 2 red 2 s blue 3 3 yellow 4 b black
A type is obje
Personally, I think it will be more succinct to just use the built-in map compared with .apply()
map
.apply()
In [13]: df[map(pred, df['B'])]