I am trying to convert separate arrays of YY, MM, DD values to a numpy datetime64 array. Here is the code
import numpy as np
iyy = [2020, 2020, 2019, 2018, 2017]
imm = [2, 4, 4, 6, 8]
idd = [1, 2, 3, 4, 5]
isod = []
for y, m, d in zip(iyy, imm, idd):
isod.append("%4d-%02d-%02d" % (y, m, d))
t1 = np.datetime64(np.asarray(isod))
This gives the error Could not convert object to NumPy datetime. Would appreciate any suggestions for achieving this. Thanks in advance