Created
February 18, 2021 15:57
-
-
Save GurjotSinghMahi/bc5d239046931b8126181f5c2d2b07a8 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
# read the csv file and parse the dates | |
df = pd.read_csv("raw_data.csv", parse_dates=['SubmissionDate', 'starttime', 'endtime']) | |
df['hour'] = df['SubmissionDate'].dt.hour | |
df['minute'] = df['SubmissionDate'].dt.minute | |
df['seconds'] = df['SubmissionDate'].dt.second | |
# Remove Date from SubmissionDate Column | |
df['Time'] = pd.to_datetime(df['SubmissionDate']).dt.time | |
print(tabulate(df[['Time', 'hour', 'minute', 'seconds']], headers = 'keys', tablefmt = 'psql')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment