Skip to content
Advertisement

How to find the intersection between two columns from two different dataframes

I’m trying to compare two different columns from two different DataFrames.

JavaScript

JavaScript

JavaScript

When I call:

JavaScript

The output should be just “www.google.com”

but instead this is the output I get.

JavaScript

Completely Stuck! Thank you for your help in advance!

Advertisement

Answer

The standard way to do this in pandas is an inner merge (default is how='inner'):

JavaScript

If you really want a list, chain tolist:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement