简体   繁体   English

如何读取 dataframe 上所有未命名的列?

[英]How to read all unnamed column on dataframe?

I have dataframe value data like this我有这样的 dataframe 值数据

    acolumn     bcolumn
70  0.503462    0.6
71  0.480712    0.5
72  0.505440    0.5
73  0.553907    0.5
74  0.344214    0.5

How to read the first unnamed column at dataframe?如何阅读 dataframe 的第一个未命名列? I already tried using iloc(), columns[0] and still the output is acolumn, I want the output is like this我已经尝试使用 iloc(), columns[0],但 output 仍然是一个列,我希望 output 是这样的

70, 71, 72, 73, 74

I want to use that data to labelling my graph at my website.我想使用该数据在我的网站上标记我的图表。

I think what you want is the index of the dataframe.我想你想要的是 dataframe 的索引。

Try:尝试:

df.index

Cheers.干杯。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 DASK dataframe 读取 csv 以使其没有“未命名:0”列? - How to read in csv with to to a DASK dataframe so it will not have “Unnamed: 0” column? 如何摆脱从 CSV 文件中读取的 pandas DataFrame 中的“未命名:0”列? - How to get rid of "Unnamed: 0" column in a pandas DataFrame read in from CSV file? 熊猫read_csv不会将最终(未命名)列捕获到数据框中 - pandas read_csv does not capture final (unnamed) column into dataframe 为什么熊猫数据框将列名显示为'未命名:1',未命名:2',.......'未命名:n' - Why pandas dataframe displaying column names as 'unnamed: 1', unnamed: 2',.......'unnamed: n' "重命名未命名的列熊猫数据框" - Rename unnamed column pandas dataframe 读取具有多个标题和未命名列的Excel - Read Excel with multiple headers and unnamed column 如何重命名 csv 中的“未命名:0”列? - How to rename the "Unnamed: 0" column in csv? 如何将 pandas dataframe 'unnamed 0' 列数据类型从 int64 更改为字符串或 object - How to change the pandas dataframe 'unnamed 0' column datatype from int64 to string or object 从json创建的Pandas数据框有未命名的列 - 由于未命名的列问题而无法插入MySQL - Pandas dataframe created from json has unnamed column - can't insert into MySQL due to unnamed column issue Pandas合并如何避免未命名的列 - Pandas merge how to avoid unnamed column
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM