Skip to content

Glossary: pandas Beyond the Basics

try/except

Also written: try, except

Python's way of catching an error so the program can handle or print it instead of stopping. For example, wrapping a merge in `try` and catching `pd.errors.MergeError` in `except` lets you print the error message.

Where the book teaches it

Related terms

assert