import pandas as pd #你的df有time索引,df.reset_index(False)去掉索引即可 df = pd.DataFrame([['2018-03-11 10:00:12', 1, 5], ['2018-03-11 20:00:12', 1, 5], ['2018-03-12 20:00:12', 1, 5]], columns=['date', 'a', 'b']) def f(r): r['date'] = r['date'].split(' ')[0] # 如果是日期类型直接r['date'] = r['date'].date() return r df.apply(f, axis=1).groupby('date').sum()