我正在处理以下数据帧:dfOut[1]: temp_Cdate 2013-01-01 122013-01-02 112013-01-03 102013-01-04 92013-01-05 102013-01-06 102013-01-07 112013-01-08 122013-01-09 142013-01-10 142013-01-11 122013-01-12 122013-01-13 112013-01-14 102013-01-15 102013-01-16 122013-01-17 13... 2017-01-02 82017-01-03 82017-01-04 82017-01-05 92017-01-06 92017-01-07 102017-01-08 122017-01-09 142017-01-10 142017-01-11 102017-01-12 102017-01-13 112017-01-14 142017-01-15 132017-01-16 102017-01-17 9[1770 rows x 1 columns]我需要做的是按一年中的哪一天对值进行分组,找到每组的平均值(或中值),从而获得一个新的DataFrame,其中每天的值是平均值/中值/。 .. 同一天的所有值。下面是一个例子:df_groupedOut[2]: temp_Cdate2013-01-01 122014-01-01 102015-01-01 102016-01-01 122017-01-01 112013-01-02 112014-01-02 10....2016-12-31 82017-12-31 7df_meanOut[3]: temp_Cdate1970-01-01 11 #the year is not meaningful anymore1970-01-02 11.41970-01-03 12.5....1970-12-30 7.51970-12-31 7.5谢谢你。
添加回答
举报
0/150
提交
取消