Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Duplicate items on Panel supported? #4960
import pandas as pd import numpy as np data = np.random.randn(5, 100, 5) panel = pd.Panel(data, items=list("AACDE")) panel.iloc # ValueError: Wrong number of dimensions fr = panel.loc["E"] fr.values.shape # (5, 100, 5) wrong
So this is another contrived example that I got from just running a battery of tests on random objects. Basically having a duplicate item key will bork the
I'm actually not sure whether Panel is meant to be a collection of uniquely identified DataFrames, or more like a generic 3d container that has convenient semantics for its axes. I think at one point it was the former, but as more things pull from generic it's becoming the later?
@dalejung I take it back, I think you can just remove that test and it should work (but needs some tests)....want to do a PR?
then this works