0

I have df

ID   url   date
1    vk.com    22.07.2016
2    twitter.com   22.07.2016
2    vk.com     22.07.2016
3    facebook.com    22.07.2016
4    forbes.com    22.07.2016

And I dave another df1

ID
1
3
4
5
9

And I want delete string from df, if ID not in df1. Desire output:

ID   url   date
1    vk.com    22.07.2016
3    facebook.com    22.07.2016
4    forbes.com    22.07.2016

I try df[df.ID in df1['ID']] but it return TypeError: 'Series' objects are mutable, thus they cannot be hashed

NineWasps
  • 2,081
  • 8
  • 28
  • 45

0 Answers0