0

Why does one value show value is ambiguous and the other does not when accessing a dataframe? It seems the only difference is the if statement. Is there a way to re-write it without using multiple if statements?

import pandas as pd

pd.isna(contact_table[contact_table['ID'] == '0000589624']['CONTACT_DATE'])

1 True Name: FIRST_CONTACT_DATE, dtype: bool

if (pd.isna(contact_table[contact_table['ID'] == '0000589624']['CONTACT_DATE'])): pass

ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

Soccer12
  • 1
  • 1

0 Answers0