あれもPython,これもPython

Pythonメモ※本サイトはアフィリエイトを利用しています

2020-06-30から1日間の記事一覧

Pandasでdate_trunc的な処理をする(resampleを使う)

pandasで日付ごとに集約する場合、resampleを使うと非常に楽です。 注意点としては、indexに入れておく必要があるところでしょうか。 date_trunc的な挙動 import pandas as pd #365日のデータ one_year = pd.Series(1,index = pd.date_range(start='2020-01-…