본문 바로가기

Programming/Python

[Pandas] DataFrame 기간별 데이터 산출하기

1. resample() 사용하기

# 1달 단위 개수 확인

df["timestamp"] = pd.to_datetime(df["timestamp"])
df.set_index("timestamp").resample("1M").count()

 

 

참고)

https://rfriend.tistory.com/494