0

I have 2 Pandas Dataframes with one column (ID).

the first one look like this:

ID
1
2
3
4
5

and the second one look like this:

ID
3
4
5
6
7

I want to make a new Dataframe by combining those 2 Dataframes, but only the value that exist on both Dataframe.

This is the result that I want:

ID
3
4
5

can you show me how to do this in the most efficient way with pandas? Thank you

prs_wjy
  • 185
  • 1
  • 12

0 Answers0