Pandas で groupby() 関数を使うと,データセットをグループ化して集計できる.さらに Grouper オブジェクトと組み合わせると,より高機能なグループ化を実現できる.今回は groupby() 関数と Grouper オブジェクトを組み合わせて「時系列データの集計」を試す.最後に関連する resample() 関数も試す. pandas.DataFrame.groupby — pandas 1.2.4 documentation pandas.Grouper — pandas 1.2.4 documentation データセット 🪢 今回使うサンプルデータセットを準備する.まず,Pandas の date_range() 関数を使って 2020/1/1 ~ 2020/12/31 の範囲で1年間の DatetimeIndex を作る.そして DatetimeIndex をイ
![Pandas で時系列データをグループ化して集計できる「Grouper」 - kakakakakku blog](https://cdn-ak-scissors.b.st-hatena.com/image/square/136c086461bc39cd43f15f44f0d09111b1f582ef/height=288;version=1;width=512/https%3A%2F%2Fcdn-ak.f.st-hatena.com%2Fimages%2Ffotolife%2Fk%2Fkakku22%2F20210419%2F20210419174822.png)