user12052274
user12052274

Reputation: 41

Panel in Pandas

While I am using pandas Panel, it shows that Panel function takes no argument...

My code -

data = {'Item1' : pd.DataFrame(np.random.randn(4, 3)), 'Item2' : pd.DataFrame(np.random.randn(4, 2))}
panel = pd.Panel(data)
panel

The output -

TypeError: Panel() takes no arguments

Then, I try

dir(pandas)

In that, Panel function is not in the pandas-dir()

pandas version (v 0.25.1)

But This code -

p = pd.Panel()
p

output -

<pandas.__getattr__.<locals>.Panel at 0xec5cfc8>

After that, I checked

dir(pandas.__getattr__)

The panel is not present in this function too

Any suggestion , Thank you

Upvotes: 2

Views: 1868

Answers (1)

Xukrao
Xukrao

Reputation: 8634

The Panel object is deprecated and all its functionality was removed in pandas 0.25.

You can use the standard DataFrame with multi-level index instead for representing 3-dimensional (or even higher-dimensional) data sets.

Upvotes: 2

Related Questions