lundi 26 octobre 2020

Use a dataframe in an if test

Mine is simple but then so am I looks like.

My program is pulling a 1 to many df from two other dfs. I'm trying to check values in a column against a string list.

#****************** \EmergencyHCPCS = ['A0426', 'A0427', 'A0429', 'A0433', 'A0434']

\print(TCharges.HCPCS) <---This works

if TCharges.HCPCS in EmergencyHCPCS: <--Error The truth value of a Series is ambiguous.

#********************* I know it's something fundamental and am prepared to take abuse.

Thanks for any help.

Aucun commentaire:

Enregistrer un commentaire