Q:

why the map function removes column from the dataframe

I have a csv file
datetime,name
20-10-2019 14:55,a
19-10-2019 14:55,b

when i apply map method second column gone
df.info()
#df['datetime'] = df['datetime'].astype(str) # if your object is datatime
df1 = df['datetime'].map(lambda x: x.split(' ')[0])
df1.to_frame()

My Out
datetime
0   2019-10-20
1   2019-10-19

My expected out include the column name 'name' also. Is there any regex to do this operation

A:

It's not that map removed a column or that a column has been removed at all. You simply selected a single column from your dataframe so that is what you end up getting.
Try
df['datetime'] = df['datetime'].map(...)

to update the datetime column in your original dataframe instead. 

