May-11-2018, 10:45 AM
(This post was last modified: May-11-2018, 10:46 AM by Jack_Sparrow.)
Hi there,
I have follow column:
0 2017-05-29 18:36:27
1 2017-06-12 19:00:33
2 2017-02-13 17:02:02
3 2017-04-24 18:39:45
4 2017-01-26 15:36:07
5 2017-06-21 09:43:54
6 2017-04-24 08:33:31
7 2017-03-21 07:23:58
8 2017-01-14 12:16:20
From this column I want to extract the time in this format: hh:mm:msec
How can I do this in python3?
Here u can see my first try:
I have follow column:
0 2017-05-29 18:36:27
1 2017-06-12 19:00:33
2 2017-02-13 17:02:02
3 2017-04-24 18:39:45
4 2017-01-26 15:36:07
5 2017-06-21 09:43:54
6 2017-04-24 08:33:31
7 2017-03-21 07:23:58
8 2017-01-14 12:16:20
From this column I want to extract the time in this format: hh:mm:msec
How can I do this in python3?
Here u can see my first try:
import pandas as pd
filename = 'chicago.csv'
# load data file into a dataframe
df = pd.read_csv('chicago.csv')
#print (df.head())
# convert the Start Time column to datetime
df1 = pd.to_datetime(df['Start Time'])
print (df1)The results see on the top: It gives me date_time column
