# convert multi index to single index : reset_index
s_roll_incdec = df_covid.groupby(["gubun"], group_keys=False)["incdec"].rolling(7).sum().reset_index(drop=True)
'언어 꿀Tip > Python 꿀tip!' 카테고리의 다른 글
07_07_32. group별로 ts time series 한번에 만들기 (0) | 2021.04.26 |
---|---|
07_01_31. 데이터프레임 groupby 계산시 컬럼명(column) 변경 (0) | 2021.04.12 |
07_01_29. isocalendar() 일자의 주차 구하기 weeknum (0) | 2021.04.12 |
07_01_28. 오른쪽 특정 문자 삭제하기 (0) | 2021.04.09 |
07_01_27. groupby rolling sum & Series name 변경 (0) | 2021.04.09 |