Since then, I fixed the error that caused the DataError, but I can’t understand for the rest of my life how to catch it explicitly:
try:
df["my column"] = df.baddata + df.morebaddata
except DataError:
print "Caught Error!"
It gives: NameError: name 'DataError' is not defined
Then I tried pd.core.frame.DataErrorand received AttributeError. I also tried Google, but could not find a list of pandas error types. What is the right way for DataError?
source
share