Skip to content

Instantly share code, notes, and snippets.

@mura8460
Created August 15, 2021 05:16
Show Gist options
  • Save mura8460/0f98b44e7fbd925b441df9cf47e86e09 to your computer and use it in GitHub Desktop.
Save mura8460/0f98b44e7fbd925b441df9cf47e86e09 to your computer and use it in GitHub Desktop.
import pandas as pd
import datetime
now = datetime.datetime.now(pytz.timezone('Asia/Tokyo'))
df = pd.DataFrame({
'タイトル' : [1, 2, 3],
'掲載日' : ['2021/8/15', '2021/8/14', '2021/8/16']
})
print(now)
df['掲載日'] = pd.to_datetime(df['掲載日'])
df_new = df.loc[df['掲載日'] >= now]
print(str(df_new))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment