设法做到这一点:
b = pd.read_csv('b.dat')b.index = pd.to_datetime(b['date'],format='%m/%d/%y %I:%M%p')b.groupby(by=[b.index.month, b.index.year])要么
b.groupby(pd.Grouper(freq='M')) # update for v0.21+

设法做到这一点:
b = pd.read_csv('b.dat')b.index = pd.to_datetime(b['date'],format='%m/%d/%y %I:%M%p')b.groupby(by=[b.index.month, b.index.year])要么
b.groupby(pd.Grouper(freq='M')) # update for v0.21+