Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. import datetime
  2.  
  3. def time_stamp(df,time_col):
  4. df[time_col] = pd.to_datetime(df[time_col])
  5. df["year"] = df[time_col].dt.year
  6. df["month"] = df[time_col].dt.month
  7. df["day"] = df[time_col].dt.day
  8. df['day_of_yr']=df[time_col].dt.strftime('%j').astype(int)
  9. time_stamp(df,"Latest Launch")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement