Created
April 25, 2020 10:33
-
-
Save aniruddha27/c366f4caade8ef3365324ab3201c794c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# day | |
df['Day'] = df['Start_date'].dt.day | |
# month | |
df['Month'] = df['Start_date'].dt.month | |
# year | |
df['Year'] = df['Start_date'].dt.year | |
# hour | |
df['Start_hour'] = df['Start_date'].dt.hour | |
# minute | |
df['Start_minute'] = df['Start_date'].dt.minute | |
# second | |
df['Start_second'] = df['Start_date'].dt.second | |
# Monday is 0 and Sunday is 6 | |
df['Start_weekday'] = df['Start_date'].dt.weekday | |
# week of the year | |
df['Start_week_of_year'] = df['Start_date'].dt.week | |
# duration | |
df['Duration'] = df['End_date']-df['Start_date'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment