'Compare one column of multiple dataframes
I first imported different tsv files and converted them into dataframes. df1:
| ID | col1 | col2 |
|---|---|---|
| ABC | 1 | 1 |
| BCA | 2 | 1 |
| CAB | 0 | 2 |
df2
| ID | col1 | col2 |
|---|---|---|
| BBC | 1 | 2 |
| ABC | 1 | 1 |
| AAA | 2 | 1 |
and df3
| ID | col1 | col2 |
|---|---|---|
| BBC | 1 | 2 |
| ABC | 1 | 1 |
| CAB | 2 | 1 |
Now I want to check which of the IDs in dataframe1 does not occur in the other ones. I only found and tried things like this:
df_1[~df_1.Id.isin(df_2.Id)]
How can I check at once which IDs are exclusively present in one of the dataframes?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
