[英]How to retrieve all indexes from pandas DataFrame
如何從pandas 0.10.1 DataFrame檢索所有索引?
我嘗試在文檔和網絡上查找,但至少半小時后仍未找到任何結果。
謝謝,斯拉瓦
正如Jeff所提到的,您將在官方文檔中找到此信息。 例:
>>> df = DataFrame(np.random.rand(3,2), index = list('abc'), columns=list('df'))
>>> df
d f
a 0.629197 0.921025
b 0.534993 0.018760
c 0.156801 0.298251
指數:
>>> df.index
Index([a, b, c], dtype=object)
列:
>>> df.columns
Index([d, f], dtype=object)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.