一种简单的方法是对索引的第一级进行分组-遍历groupby对象将返回组密钥和包含每个组的子帧。
In [136]: for date, new_df in df.groupby(level=0): ...: print(new_df) ...: observation1 observation2date Time 2012-11-02 9:15:00 79.3736682249:16:00 130.841316477 observation1 observation2date Time 2012-11-03 9:15:00 45.3128148359:16:00 123.7769466239:17:00 153.7664606249:18:00 463.2769466269:19:00 663.1769346229:20:00 763.773330621 observation1 observation2date Time 2012-11-04 9:15:00 115.4494371229:16:00 123.7769465559:17:00 153.7664603449:18:00 463.276946212
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)