Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.to() method not available within the pint dataframe accessor #232

Open
mflova opened this issue May 23, 2024 · 1 comment
Open

.to() method not available within the pint dataframe accessor #232

mflova opened this issue May 23, 2024 · 1 comment

Comments

@mflova
Copy link

mflova commented May 23, 2024

I was playing with some of the examples within the docs. Here I found there is supposed to be pint.to() to convert to specific units. I tried to followed the example in this page but .to seems not to be an attribute of the Pint dataframe accessor.

I printed the attributes of the accessor and I got: convert_object_dtype, dequantify, quantify, to_base_units. I saw from the source code that some other attributes such as to are delegated to the Series, but not to the dataframe. If there are future intentions of adding it to the whole dataframe, I will be happy to add it

@andrewgsavage
Copy link
Collaborator

It's a series accessor. You could make a pr adding a data frame accessor. You'd need to handle columns with non pint type, such as int or float or string, and pint types that have different dimensionality so shouldn't be converted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants