I have a notebook that I'm using to learn, and I'd like to "keep" the errors in there as instructions to myself on what not to do. Here's a basic example:
# (1b) Rename with a list of data
df['cost_bad'] = [1,2] # <-- this will error, since the length of the List/Series must match the numRows
df['cost_good'] = ...
However, this will (obviously) error on the first python statement and never run to the second one. Is there a way to set the notebook to execute all statements, even if a previous on errors? I know I can do something like:
try:
df['cost_bad'] = [1,2] # <-- this will error, since the length of the List/Series must match the numRows
except:
traceback.print_exc()
But I was wondering if I could do this without the try/except
and just continue execution.