Flexible and powerful data analysis / manipulation library for Python, providing labeled data structures similar to R data.frame objects, statistical functions, and much more
prediction
id area datetime
A de 2020-01-09 0.768346
2020-01-10 0.768346
fr 2020-01-01 0.159567
2020-01-02 0.722039
2020-01-03 0.722039
2020-01-04 0.922641
2020-01-05 0.922641
2020-01-06 0.922641
2020-01-07 0.922641
2020-01-08 0.922641
B de 2020-01-01 0.158251
2020-01-02 0.814331
2020-01-03 0.814331
2020-01-04 0.814331
2020-01-05 0.814331
2020-01-06 0.943016
fr 2020-01-07 0.975385
2020-01-08 0.975385
2020-01-09 0.975385
2020-01-10 0.975385
Issue Description
The only difference is that in the second case I am explicitly selecting a single column [[predictions]] whereas in the first example I am calling it on the full dataframe. This shouldn't make a difference as the dataframe only contains the predictions column outside of the columns used to group and roll on.
This difference causes two issues in the dataframe where I don't select a subset of the columns:
The old index is appended as an additional unnamed level
The datetime column is kept as a column instead of as an index level
Expected Behavior
I would expect both cases to behave the way the second example does, with id, area, datetime as the index levels.
Pandas version checks
[X] I have checked that this issue has not already been reported.
[X] I have confirmed this bug exists on the latest version of pandas.
[ ] I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
Issue Description
The only difference is that in the second case I am explicitly selecting a single column
[[predictions]]
whereas in the first example I am calling it on the full dataframe. This shouldn't make a difference as the dataframe only contains the predictions column outside of the columns used to group and roll on.This difference causes two issues in the dataframe where I don't select a subset of the columns:
Expected Behavior
I would expect both cases to behave the way the second example does, with
id, area, datetime
as the index levels.Installed Versions