赞
踩
import pandas as pd df1 = pd.read_csv("data/trans/bike_flow.csv") # ['t_idx' 'r_idx' 'c_idx' 'bike_out_cnt' 'bike_in_cnt' 'flow_stay' 'flow_in' 'flow_out'] print(df1.columns.values) # (23016, 8) print(df1.shape) # ['t_idx', 'bike_in_cnt']是取特定的列 # df1['bike_in_cnt'] > 10是取特定的行 df2 = df1[['t_idx', 'bike_in_cnt']][df1['bike_in_cnt'] > 10] # (328, 2) print(df2.shape)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。