Saturday, 10 August 2013

Python pandas change duplicate timestamp to unique

Python pandas change duplicate timestamp to unique

I have a file containing duplicate timestamps, two for each timestamp,
actually they are not duplicate, it is just the second timestamp needs to
add a millisecond timestamp. For example, I am having these in the file,
.... 2011/1/4 9:14:00 2011/1/4 9:15:00 2011/1/4 9:15:01 2011/1/4 9:15:01
2011/1/4 9:15:02 2011/1/4 9:15:02 2011/1/4 9:15:03 2011/1/4 9:15:03
2011/1/4 9:15:04 ....
I would like to change them into 2011/1/4 9:14:00 2011/1/4 9:15:00
2011/1/4 9:15:01 2011/1/4 9:15:01.500 2011/1/4 9:15:02 2011/1/4
9:15:02.500 2011/1/4 9:15:03 2011/1/4 9:15:03.500 2011/1/4 9:15:04 ....
what is the most efficient way to perform such task?

No comments:

Post a Comment