1 Replies - 167 Views - Last Post: 11 October 2019 - 06:40 AM Rate Topic: -----

#1 sx200n   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 57
  • Joined: 07-July 17

Listing duplicates in pandas

Posted 11 October 2019 - 06:37 AM

Hello,
I have a University assignment that includes a simple problem. I have been given two dataframes containing the same data material but from different years. One question is asking me to return a list of all values that appear in the 'Country' column of the two datasets.

The mark for this question is low and it needs to be done using simple pandas methods (hence the low marks on offer) , but I cannot think how to do this. I am familiar with the duplicate() method, but that returns booleans where I need to return a list of matching values.

Any pointers in the right direction?

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Listing duplicates in pandas

#2 DK3250   User is online

  • Pythonian
  • member icon

Reputation: 561
  • View blog
  • Posts: 1,794
  • Joined: 27-December 13

Re: Listing duplicates in pandas

Posted 11 October 2019 - 06:40 AM

Can you submit the two dataframes?
This will probably make it easier to hint you in the right direction...
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1