无法在短轴中定位项目

2024-06-26 10:48:19 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试使用以下面板进行一些pd.Panel操作:

print(panell)
print(panell.shape)

给出:

<class 'pandas.core.panel.Panel'>
Dimensions: 9 (items) x 60 (major_axis) x 114 (minor_axis)
Items axis: 31.5hz to 8000hz
Major_axis axis: 2018-10-22 07:00:00 to 2018-10-24 18:00:00
Minor_axis axis: (1, 1) to (38, 3)

(9, 60, 114)

然后我想在minor_axis上循环,但它找不到正确的标签。例如,两者:

print(panell.loc[:,:,'(38, 3)'])
print(panell[:,:,'(38, 3)'])

给出:

KeyError: 'the label [(38, 3)] is not in the [minor_axis]'

有什么建议吗


Tags: thetocore面板pandasclassdimensionspd