DataFrame概念(可以通俗理解为excel中一片数据)
表格型数据结构,带有标签的二维数组,有行标签(index)和列标签(columns),其值可以是数值、字符串、布尔值等。
1、.index 行标签
2、.columns 列标签
3、.values 值
.4、dtypes return the dtypes in the DataFrame.
# -*- coding: utf-8 -*-
import pandas as pd
d = {'col1': [1, 2], 'col2': [3, 4]}
df = pd.DataFrame(data=d)
print(df)
print(df.index)
print(df.columns)
print(df.values)
print(df.dtypes)
D:python3installpython.exe D:/python/py3script/test.py
col1 col2
0 1 3
1 2 4
RangeIndex(start=0, stop=2, step=1)
Index(['col1', 'col2'], dtype='object')
[[1 3]
[2 4]]
col1 int64
col2 int64
dtype: object
Process finished with exit code 0
一:数组/list组成的字典创建DataFr