LoginSignup
1
1

More than 1 year has passed since last update.

pandasで今日の日付を追加する

Last updated at Posted at 2021-06-25

結構、前に困ったやつ
メモしておこう

import pandas as pd
import datetime
import pytz

today = datetime.datetime.now(pytz.timezone('Asia/Tokyo'))
today = today.strftime('%Y-%m-%d')

# これでもいけなくはない
# today = f'{today.year}-{str(today.month).zfill(2)}-{str(today.day).zfill(2)}'
df['update_date'] = pd.to_datetime(today)
1
1
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1