Skip to content

Instantly share code, notes, and snippets.

@mvervuurt
Created August 29, 2019 10:33
Show Gist options
  • Save mvervuurt/ef567d67cd9a1dd0904aefe9a6cab38b to your computer and use it in GitHub Desktop.
Save mvervuurt/ef567d67cd9a1dd0904aefe9a6cab38b to your computer and use it in GitHub Desktop.
Pandas datetime
import pandas as pd
#really neat trick to create a Pandas datetime from several columns
df['date']=pd.to_datetime(dict(year=df['year'], month=df['month'], day=1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment