エントリーの編集
エントリーの編集は全ユーザーに共通の機能です。
必ずガイドラインを一読の上ご利用ください。
全国の都道府県知事の年齢と当選回数を調べる - Qiita
記事へのコメント0件
- 注目コメント
- 新着コメント
このエントリーにコメントしてみましょう。
注目コメント算出アルゴリズムの一部にLINEヤフー株式会社の「建設的コメント順位付けモデルAPI」を使用しています
- バナー広告なし
- ミュート機能あり
- ダークモード搭載
関連記事
全国の都道府県知事の年齢と当選回数を調べる - Qiita
import datetime import re import pandas as pd import matplotlib.pyplot as plt def wareki2date(s):... import datetime import re import pandas as pd import matplotlib.pyplot as plt def wareki2date(s): m = re.search("(昭和|平成|令和)([ 0-9元]{1,2})年( [0-9]{1,2})月([ 0-9]{1,2})日", s) if m: year, month, day = [1 if i == "元" else int(i.strip()) for i in m.group(2, 3, 4)] if m.group(1) == "昭和": year += 1925 elif m.group(1) == "平成": year += 1988 elif m.group(1) == "令和": year += 2018 return pd.Timestamp(year, mon