python-pandas的df的一些用法

import pandas as pd

trans_df = pd.read_csv("../data/trans/bike_flow.csv")
# [record_size, column_size]
print(trans_df.shape)

# pandas.core.frame.DataFrame
print(trans_df.__class__)

# pandas.core.indexes.base.Index
print(trans_df.columns.__class__)

# 转化为value后可以直接使用数字下标[i]进行索引
# numpy.ndarray
print(trans_df.columns.values.__class__)
# numpy.ndarray
print(trans_df.values.__class__)
print(trans_df.head(2))

你可能感兴趣的:(Python)