How can I move the date into a new column within the same data frame
CodePudding user response:
IIUC you can just split the column
df['New_Column'] = df.['Date Time'].apply(lambda x : str(x).split()[1])
df
CodePudding user response:
You can try
df['Date'] = df['Date Time'].str.split(' ').str[0]
# or
df['Date'] = pd.to_datetime(df['Date Time']).date