Skip to content

Instantly share code, notes, and snippets.

@hamletbatista
Created April 20, 2019 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hamletbatista/0168c42f93f63e3ce11f657c82ac02da to your computer and use it in GitHub Desktop.
Save hamletbatista/0168c42f93f63e3ce11f657c82ac02da to your computer and use it in GitHub Desktop.
macys_set = set(macys_df["Keyword"]) #this eliminates duplicates
print(len(macys_set)) # prints -> 4210
tommy_set = set(tommy_df["Keyword"])
print(len(tommy_set)) # prints -> 4601
in_macys_only = macys_set - tommy_set #in macys but not in tommy
print(in_macys_only) # prints -> 124
in_tommy_only = tommy_set - macys_set #in tommy but not in macys
print(in_tommy_only) # prints -> 515
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment