1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

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

1
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?