I have two columns that I need to compare to third and to get data that is not same in first two columns.
import pandas as pd
from numpy import nan
df = pd.DataFrame ({'Want_value': ['a', 'c', 'c', 'c', 'v', 'b', nan, nan, nan, nan, nan, nan, nan], 'Unwanted_value': ['r', 't', 't', 'z', 't', nan, nan, nan, nan, nan, nan, nan, nan], 'new_all_data': ['r', 'z', 'a', 'c', 't', 'v', 'b', 'j', 'r', 't', 'v', 'a', 'k'], 'new_values': [nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan, nan]})
Looks like this...
Basically needs to be like this, 'Want_value' + 'Unwanted_value' and compare to column with name 'new_all_data', at the end I need values that are in 'new_all_data' but there are not in 'Want_value' and 'Unwanted_value'. I hope this is clear.
The values in this minimal reproducible example that are in 'new_all_data' and not in 'Want_value' and 'Unwanted_value' are j and k. These values needs to be in a new column that I put here as empty 'new_values'.
Thanks in advance!
