-
Notifications
You must be signed in to change notification settings - Fork 42
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
DataFrame.reset_index puts units to dataframe index cells #231
Comments
Why isn't this supposed to be the desired behaviour? This is the way |
Seeing the units in the cells mean the data is stored as an array of quantities inside the PintArray , as opposed to an array of units or floats. This looks like one of the PintArray init paths doesn't behave as expected |
Using the column dtype for the index on |
looks like it is a bug in pandas, index doesnt use the data's dtype's formating func This is as expected: df = df.set_index('a',drop=False)
i = df.index
i.values
<PintArray>
[1.0, 2.0]
Length: 2, dtype: pint[second] |
Bug description
DataFrame.set_index puts units to dataframe index cells. I was very surprised when I found out, and I currently need to work around it. For the actual dataframe data cells this behavior is clearly not intended (quote from docs):
Minimum example
Output:
The text was updated successfully, but these errors were encountered: