二维组转表
import pandas as pdarr = [['google', 100], ['amazon', 99], ['github', 233], ['microsoft', 88]]df = pd.DataFrame(data=arr, columns=['Site', 'Age'])
# 二元组转成表, 列为 Site 和 Age.
print(df)col = df['Age']# 获取Age列
print(col)# 获取Age > 100的所有行
col = df[col > 100]
print(col)# site 列包含 `oo` 字符串的
col = df[df['Site'].str.contains('oo')]
print(col)# loc 二维组获取具体的值
print(df.loc[0][0], df.loc[0][1], df.loc[0].Age)