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]
buran write Oct-16-2023, 11:06 AM:
Please, use proper tags when post code, traceback, output, etc.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc.
See BBcode help for more info.