今天在用dataframe用到的方法
- 1.取某列某个范围内的数据
data_total = data_total[(data_total['inTime'] > np.datetime64(date_begin)) & (data_total['inTime'] < np.datetime64(date_end))]
- 2.按某列统计数据
dh = dh['enterprise_id'].sum()
dh = dh['enterprise_id'].count()
- 3.遍历dataframe
for index,item in pd.iterrows():
- 4.时间截取年与日
for index,item in pd.iterrows():
date = item[9].date()