0 points

python - Pandas: Change day - Stack Overflow


dashboard

Sun Aug 09 2020 11:54:19 GMT+0000 (UTC)

Posted by @arielvol #python

import pandas as pd
from datetime import datetime

ps = pd.Series([datetime(2014, 1, 7), datetime(2014, 3, 13), datetime(2014, 6, 12)])
new = ps.apply(lambda dt: dt.replace(day=1))
content_copy Copy

https://stackoverflow.com/questions/28888730/pandas-change-day