I just started with Python. I want to add the information of the array ‘toc’ to the array ‘toc_n.’ The first two columns of both ones are ‘year’ and ‘day of the year,’ but the array ‘toc’ lacks some days (i.e., fewer rows). I wrote the following code. Could you please suggest something more efficient/clever?
for i in range(2196):
for j in range(2173):
dd = np.logical_and(toc_n[i,0] == toc[j,0] , toc_n[i,1] == toc[j,1])
if dd == True:
toc_n[i,2]=toc[j,2]
for i in range(2196):
for j in range(2173):
dd = np.logical_and(toc_n[i,0] == toc[j,0] , toc_n[i,1] == toc[j,1])
if dd == True:
toc_n[i,2]=toc[j,2]