SyntaxFix
Write A Post
Hire A Developer
Questions
You can take the sets of the columns and just subtract the smaller set from the larger set:
distinct_values = set(df['a'])-set(df['b'])