我试图将两列合并为一个。一种是Datetime dtype,一种是String。我将datetime转换为String并按如下所示执行串联。即使“发行日期”的数据类型已更改为“字符串”,它仍将引发错误“必须是str,而不是datetime.time”
数据列(共3列): 机票号码49987非空float64 发行日期49987非空对象 发布时间49987非空对象
Date_time_df['DateTime']=Date_time_df['Issue Date'].astype(str) +" "+ Date_time_df['Issue time']
Ticket number Issue Date Issue time
0 1.103341e+09 2015-12-21 12:51:00
1 1.103700e+09 2015-12-21 14:35:00
2 1.104803e+09 2015-12-21 20:55:00