Search code examples
pythonpandaspint

Python: Pandas support in Pint


I am trying to reproduce the example described in the Python Pint library here.

In the section "Reading from csv" when running the following line:

df_ = df.pint.quantify(level=-1)

I got the following message error:

AttributeError: 'DataFrame' object has no attribute 'pint'

Has anybody a solution to that?

Thanks in advance!

Best regards.


Solution

  • As @Ivan noted in the comments, you need to install pint-pandas package:

    pip install git+https://github.com/hgrecco/pint-pandas.git

    Pandas has an open issue regarding this.