Closed carlculator closed 1 year ago
import pint import numpy as np import pandas as pd from pint_pandas import PintArray ureg = pint.get_application_registry() p = PintArray(list(range(2)) + [np.nan], dtype=ureg.parse_units('m')) # <PintArray> [0.0, 1.0, nan] Length: 3, dtype: pint[meter] s = pd.Series(p) s.groupby(level=0).sum() # >>> 0 0.0 meter # >>> 1 1.0 meter # >>> 2 0 # >>> dtype: object
I think the operation should keep the unit of the series intact.
fixed by #133
I think the operation should keep the unit of the series intact.