Last active
February 18, 2021 14:00
-
-
Save GurjotSinghMahi/3a01a47e5ebf1db5d9ecf30a2fce6657 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
# Convert Date to respective day name | |
df['Date'] = (df['Date']).astype('datetime64[D]') | |
# convert Date to day name | |
df['Day'] = df['Date'].dt.day_name() | |
df['Date'] = pd.to_datetime(df['Date']).dt.date | |
# Print the dataframe | |
print(tabulate(df[['Date', 'Day', 'user_id', 'gadget']], headers = 'keys', tablefmt = 'psql')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment