I need to fill an array with dates, starting from period 2021-07-15 for 120 periods with monthly frequency. currently I use code :
dates= []
for i in range (0, len(output)):
if (i%120 == 0):
for e in[d.strftime("%Y-%m-%d") for d in pd.date_range(start='2021-7-1', periods=120,
freq='MS').shift(14,freq='D')]:
dates.append(e)
This code works no problem, but I would like to use numpy as it usually faster then pandas or list. Does anybody know how can I replace this code using numpy datetime64?