-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
  • 6,624
  • 13
  • 38
  • 62

1 Answers1

1

Try using apply with lambda.

Ex:

dataframe1.apply(lambda x: x['title'].str.contains(x['color'])
Rakesh
  • 78,594
  • 17
  • 67
  • 103
  • 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