0

我有一个数据面板,我想切片数据来绘制它。

例如。次要维度上的切片。数据是

<class 'pandas.core.panel.Panel'>
Dimensions: 71 (items) x 192 (major) x 19 (minor)
Items: gain to gain_delta
Major axis: AFG to ZWE
Minor axis: ISO3 to 2011

所以如果我想绘制这个切片:

scores.ix[['gain'],['ESP'],2:21]

<bound method Panel.to_frame of <class 'pandas.core.panel.Panel'>
Dimensions: 1 (items) x 1 (major) x 17 (minor)
Items: gain to gain
Major axis: ESP to ESP
Minor axis: 1995 to 2011>

但这些都给出错误:

scores.ix[['gain'],['ESP'],2:21].plot()

scores.ix[['gain'],['ESP'],2:21].to_frame.plot()

a=scores.ix[['gain'],['ESP'],2:21]
plot(a)

谢谢!

4

1 回答 1

0

我不认为你可以绘制一个面板。

要从面板中提取系列(和绘图),您可以使用ix以下语法:

scores.ix['gain', 'ESP', 2:21].plot()
于 2012-11-14T23:41:26.073 回答