I am merging a dataframe with a static dataframe (a table in a spreadsheet) that results in a dataframe that looks like this:
Counterparty DealType Commodity Product
Aron Buy AAA NaN
Aron Buy AAA NaN
Aron Buy AAA NaN
Aron Buy BBB prod1
Aron Buy BBB prod1
Aron Buy BBB prod1
Aron Buy CCC NaN
Aron Buy CCC NaN
Aron Buy CCC NaN
If the dataframe has no NaN values in the Product Column then the merge was successful and my program can continue.
However, if NaN values do exist in the product column I need to update my spreadsheet with the missing values.
this is the code I have which returns true if there is any NaN values:
if (df['Commodity'].isnull().any()):
print('missing values found')
# get list of missing values
sys.exit(0)
but I want to return a list of the missing values like ['AAA', 'CCC']