Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/305.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何从DataFrame检索所有索引_Python_Indexing_Pandas - Fatal编程技术网

Python 如何从DataFrame检索所有索引

Python 如何从DataFrame检索所有索引,python,indexing,pandas,Python,Indexing,Pandas,如何从0.10.1数据帧检索所有索引 我试图在文档和网络上查找,但至少半个小时后仍然没有任何结果 谢谢, 斯拉瓦正如杰夫提到的,你可以在网站上找到这些信息。例如: >>> 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.10.1数据帧检索所有索引

我试图在文档和网络上查找,但至少半个小时后仍然没有任何结果

谢谢,
斯拉瓦

正如杰夫提到的,你可以在网站上找到这些信息。例如:

>>> 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)

正如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)

try:df.index,df.columns,新用户文档位于:try:df.index,df.columns,新用户文档位于: