Data
lst=array(['2019-08-30T00:00:00.000000000', '2019-09-30T00:00:00.000000000',
'2019-10-31T00:00:00.000000000', '2019-11-29T00:00:00.000000000',
'2020-01-23T00:00:00.000000000', '2020-02-28T00:00:00.000000000'],
dtype='datetime64[ns]')
Goal
I want to get next month first date for each element in the above array. For example, 2019-08-30T00:00:00.000000000 will be '2019-09-01T00:00:00.000000000',2020-01-23T00:00:00.000000000 will be
2020-02-01T00:00:00.000000000,the final ouput will be dictionary like {'2019-08-30T00:00:00.000000000':'2019-09-01T00:00:00.000000000',……}
Try
It's easy to get by +timedelta(days=1) for some elements, but it's hard for '2020-01-23T00:00:00.000000000' etc.