python中columns是什么意思 |
您所在的位置:网站首页 › spiderman什么意思啊 › python中columns是什么意思 |
Pandas DataFrame是带有标签轴(行和列)的二维大小可变的,可能是异构的表格数据结构。算术运算在行和列标签上对齐。可以将其视为Series对象的dict-like容器。这是 Pandas 的主要数据结构。 Pandas DataFrame.columns属性返回给定Dataframe的列标签。 用法: DataFrame.columns 参数:没有 返回:列名 范例1:采用DataFrame.columns属性以返回给定Dataframe的列标签。 # importing pandas as pd import pandas as pd # Creating the DataFrame df = pd.DataFrame({'Weight':[45, 88, 56, 15, 71], 'Name':['Sam', 'Andrea', 'Alex', 'Robin', 'Kia'], 'Age':[14, 25, 55, 8, 21]}) # Create the index index_ = ['Row_1', 'Row_2', 'Row_3', 'Row_4', 'Row_5'] # Set the index df.index = index_ # Print the DataFrame print(df) 输出: 现在我们将使用DataFram |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |