pandas.DataFrame.axes#

property DataFrame.axes#

返回表示DataFrame轴的列表。

它将行轴标签和列轴标签作为唯一的成员。它们将按该顺序返回。

示例

>>> df = pd.DataFrame({'col1': [1, 2], 'col2': [3, 4]})
>>> df.axes
[RangeIndex(start=0, stop=2, step=1), Index(['col1', 'col2'],
dtype='object')]