Splitting timestamp column into separate date and time columns

后端 未结 7 765
执念已碎
执念已碎 2020-11-27 06:29

I have a pandas dataframe with over 1000 timestamps (below) that I would like to loop through:

2016-02-22 14:59:44.561776

I\'m having a har

7条回答
  •  再見小時候
    2020-11-27 06:40

    try this:

    def time_date(datetime_obj):
        date_time = datetime_obj.split(' ')
        time = date_time[1].split('.')
        return date_time[0], time[0]
    

提交回复
热议问题