Date and time in the same cell separated
Many times you need to separate the date and time in a cell, as shown in the figure below:
First of all, method 1: it can also be realized by using the column function of Excel. The disadvantage is that there will always be problems in the subsequent pandas analysis.
You can use the following method:
df_1['date']=df_1['日期'].astype(str).apply(lambda x: x.split(" ")[0])
df_1['time']=df_1['日期'].astype(str).apply(lambda x: x.split(" ")[1])
df_1
The result is as follows: