-1

I have to check title column contains color value from color column.

dataframe1['title'].str.contains(dataframe1['color'])

I am getting an error as

TypeError: 'Series' objects are mutable, thus they cannot be hashed

Musakkhir Sayyed
  • 7,012
  • 13
  • 42
  • 65

1 Answers1

1

Try using apply with lambda.

Ex:

dataframe1.apply(lambda x: x['title'].str.contains(x['color'])
Rakesh
  • 81,458
  • 17
  • 76
  • 113
  • 1
    `dataframe1.apply(lambda x: " ".join([dataframe1['brand'], dataframe1['title']]) if not x['title'].str.contains(x['brand']))` ? – Rakesh May 21 '18 at 06:45