15 lines
365 B
Python
15 lines
365 B
Python
import pandas as pd
|
|
|
|
# Sample DataFrames
|
|
df1 = pd.DataFrame({'A': [1, 2, 3, 4],
|
|
'B': ['a', 'b', 'c', 'd']})
|
|
|
|
df2 = pd.DataFrame({'A': [3, 4, 5, 6],
|
|
'B': ['c', 'd', 'e', 'f']})
|
|
|
|
# Find uncommon elements
|
|
uncommon_df = pd.concat([df1, df2, df2]).drop_duplicates(keep=False)
|
|
|
|
# Display the resulting DataFrame
|
|
print(uncommon_df)
|