I made a DataFrame in Pandas and made a DataFrame like below.
if (a['conversion'] == line.strip().any() \
or (a['x'] == line.strip().any() \
or (a['y'] == line.strip().any() \
or (a['z'] == line.strip().any():
generate(line)
so basically, I would like to check both keys x, y and z but some types does not have key 'y' or 'z'. So KeyError: 'y' was raised.
How can I only approach existing keys? or do I have to use try/except? or if I have to use .get(['y]) function, how can I implement it? (it did not really work)