Pandasで国民の祝日を除く平日を作成
import pandas as pd
holidays = pd.read_csv(
"https://www8.cao.go.jp/chosei/shukujitsu/syukujitsu.csv",
encoding="cp932",
parse_dates=[0],
)["国民の祝日・休日月日"].values
# 曜日指定
# weekmask_egypt = "Sun Mon Tue Wed Thu Fri Sat"
# bday_egypt = pd.offsets.CustomBusinessDay(holidays=holidays, weekmask=weekmask_egypt)
# 平日
bday_egypt = pd.offsets.CustomBusinessDay(holidays=holidays)
df_dates = pd.date_range("2021-01-01", "2021-01-31", freq=bday_egypt)
Author And Source
この問題について(Pandasで国民の祝日を除く平日を作成), 我々は、より多くの情報をここで見つけました https://qiita.com/barobaro/items/ea867d83241c4db76a62著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .