pandas
df = pd.DataFrame({"col1":[1,2,3], "col2": ["a","b","c"]})
'''
df2
col1 col2
0 1 a
1 2 b
2 3 c
'''
dtypes
DataFrame.shape 是 pandas Series 和 DataFrame 的一个属性(记住 读写教程,属性不要加括号),它包含行数和列数:(行数, 列数)。pandas Series 是 1 维的,只返回行数。
選擇多列:df[["col1","col2"]] 成一個新的DataFrame
Filter

loc,iloc (可變引用)
df.loc[titanic["Age"] > 35, "Name"]
titanic.iloc[9:25, 2:5] = ...
- 使用
loc进行基于标签的选择(使用行/列名称)。 - 使用
iloc进行基于位置的选择(使用表格位置)。