--> Python and pandas, oh my: a rich ecosystem of open source tools for petrophysical and geological assessment

AAPG Pacific Section and Rocky Mountain Section Joint Meeting

Datapages, Inc.Print this page

Python and pandas, oh my: a rich ecosystem of open source tools for petrophysical and geological assessment

Abstract

Python is an open source, interpreted programming language with a rich ecosystem of freely available libraries that can be used to extend its capabilities. Pandas is a Python library that leverages vectorization for rapid and powerful computations on matrix-like dataframes. In combination with tools from the standard Python library and other external modules (e.g., NumPy, Lasio), Python and pandas have proven to be a powerful toolset in many scientific domains, and geology and petrophysics are no exception. In a recent reservoir characterization project, we used these tools to analyze digital well log data. Lasio was used to create LAS-data python objects, and pandas was used to concatenate all the digital log data into a single dataframe. NumPy and pandas were used to create zones of arbitrary thicknesses, and allow for rapid reassignment of zone thicknesses, which is very useful in stacked fluvial sand plays like the Lance Formation. Pandas was used to pivot data tables and compute statistics on complicated groupby objects, and Matplotlib was used to plot the results. Jupyter Notebooks were used to track workflows and present findings. These represent only a very small number of the tools available to a Python programmer. For example, many open source machine learning libraries are available in Python, and a petrophysicist or geologist could easily leverage those tools for geology-based cluster analysis and decision-tree classification of facies. In addition to being a powerful programming language, Python also has the advantage of being free, making it easy to transfer workflows and projects to collaborators and clients. This contrasts with many proprietary software packages, which often cost many thousands of dollars in annual licensing fees and may offer inadequate customer support.