In [8]:
from datetime import datetime
import pandas as pd
In [4]:
pd.__version__
Out[4]:
In [7]:
df = pd.DataFrame({
"name":["alice","bob","charlie", "david"],
"age":[12,43,22,34]
})
df
Out[7]:
In [10]:
df["time"] = pd.Timestamp(datetime.now())
df
Out[10]:
In [14]:
df = pd.DataFrame({
"name":["alice","bob","charlie", "david"],
"age":[12,43,22,34]
})
df["time"] = pd.Timestamp(datetime.now())
df
Out[14]:
In [16]:
df["time_str"] = df["time"].map(lambda ts: ts.strftime("%d-%m-%Y"))
df
Out[16]:
In [ ]: