Adding tops to a pandas DataFrame

When working with well log data in a pandas DataFrame, it is very likely that you’ll want to explore your data in the context of geologic zones. By adding zone labels to each row of your DataFrame, it is possible to use some of the fun and powerful features of pandas, like groupby() for stats aggregations. And while the process for adding tops to a DataFrame is not obvious, it is simple.