python - Pandas: Change day - Stack Overflow

PHOTO EMBED

Tue May 11 2021 15:02:25 GMT+0000 (Coordinated Universal Time)

Saved 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_copyCOPY

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