Skip to content

Duplicate items on Panel supported? #4960

Closed
@dalejung

Description

@dalejung
import pandas as pd
import numpy as np

data = np.random.randn(5, 100, 5)
panel = pd.Panel(data, items=list("AACDE"))

panel.iloc[0] # 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 Panel.

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?

Metadata

Metadata

Assignees

Labels

BugIndexingRelated to indexing on series/frames, not to indexes themselves

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions