I have a dataframe (df) with the index as datetime index in "%Y-%m-%d %H:%M:%S.%f
" format i.e 2012-06-16 15:53:42.457000
.
I am trying to create groups of 1 second using groupby method i.e
x= df.groupby(pd.TimeGrouper('1S'))
time=x.first().index[1]
print time
The problem is using groupby method i am only getting the timestamp in seconds only i.e "2012-06-16 15:53:42
" , the milliseconds are excluded. Is there a way to get the complete timestamp?
thank you