Pint-Pandas is a Python library that extends Pandas DataFrames and Series to seamlessly integrate physical quantities with units, leveraging the Pint library. It enables units-aware operations directly within Pandas data structures, ensuring dimensional consistency and preventing common unit errors. The library is actively maintained, with version 0.8.0 released on March 19, 2026. It's important to note that the Pandas integration is still considered experimental by the underlying Pint project.
pip install pint-pandasVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to create a Pandas DataFrame with unit-aware columns using `pint[unit]` dtypes. It then shows how to perform arithmetic operations that automatically handle unit conversions and dimensional analysis. Finally, it illustrates how to convert units of a Series using the `.pint` accessor.
Always refer to the latest documentation and test thoroughly, especially for critical applications.
If units are not needed, explicitly extract magnitudes using `.pint.magnitude`. If units are critical, ensure operations are units-aware or explicitly convert units before array conversion.
Always check the `pint-pandas` changelog and documentation for the exact compatible versions of `pandas` and `pint` for your desired `pint-pandas` version. Ensure your Python environment meets the minimum `requires_python` of `pint-pandas` and `pandas`.
Run `pip install pint-pandas` or `conda install -c conda-forge pint-pandas` to install the package.
After loading data, use the `.pint.quantify()` or `.pint.convert_object_dtype()` accessor methods to correctly convert the `object` columns into `PintArray` dtypes. For example: `df = df.pint.quantify(level=-1)` if units are in the header, or `df = df.pint.convert_object_dtype()` for Series of Quantities.
Instead of in-place operations, reassign the result of the method. For example, use `s = s.pint.to('new_unit')` instead of `s.pint.ito('new_unit')`.