更新时间:2022-11-14 09:06:22
获取index
值作为list
/list
的Index/MultiIndex
的代码>元组s 做:
To get the index
values as a list
/list
of tuple
s for Index
/MultiIndex
do:
df.index.values.tolist() # an ndarray method, you probably shouldn't depend on this
或
list(df.index.values) # this will always work in pandas