I am trying to obtain the first day of month from array of datetime i.e. change all days to 1
and all hours to 0
:
import pandas as pd
z1 = [datetime(2025, 10, 1, 3, 0),datetime(2025, 1, 6, 7, 0)]
pd.DatetimeIndex(z1).normalize()
DatetimeIndex(['2025-10-01', '2025-01-06'], dtype='datetime64[ns]', freq=None)
I was hoping to achieve
DatetimeIndex(['2025-10-01', '2025-01-01'], dtype='datetime64[ns]', freq=None)