Closed Musaefendic closed 5 months ago
that looks correct, pd.Series(result, dtype='pint[g/kg]')
tells pint-pandas to convert result from [dimensionless] to [g/kg], so it multiplies by 1e3
you could:
result = 50. * CO / 10. * CO2
, which maintains unitsresult = (1000. * 50. * CO / 10. * CO2).pint.magnitude
, which so your result is an numpy array, not a PintArray with units of [dimensionless]
Context
I am performing a calculation using an empirical formula.
pint-pandas
assumes that the unit of the calculation isdimensionless
, but I want to force the unit tog/kg
, to comply with the empirical formula.I recreate a
pd.Series
with the target unit, butpint-pandas
applies a factor1000
ratio that seems to be related to thegrams
unit.Question: I might have missed something in the documentation; is this the normal behavior?
Environment
I'm not using the latest versions, due to a Python=3.8 constraint. I have not yet tested with the latest versions.
Minimal Reproducible Example
Workaround