Iterate through multiple arrays, each having multiple arrays
I have three folders, each containing 675 NumPy arrays. I want to iterate over each array in each folder.
My first folder is “Barleyarea,” with several arrays (bar1.npy, bar2.npy, bar3.npy….)
My second folder is “AEIarea,” with several arrays (AEI1.npy, AEI2.npy, AEI3.npy….)
My third folder is “Areagrid,” with several arrays (area1.npy, area 2.npy, area 3.npy….)
I want to iterate over each array and perform the calculation (equation below) for each array when the arrays have a similar filename.
Finalarea1= bar1.npy\* AEI1.npy/ area1.npy
Finalarea2= bar2.npy\* AEI2.npy/ area2.npy
Finalarea3= bar3.npy\* AEI3.npy/ area3.npy

```
#find and print the Path of Bar arrays
file_paths = glob.glob(os.path.join(BarAH, '*.npy'))
array_BarAH = {os.path.basename(f): np.load(f) for f in file_paths}
# print(array_BarAH)
#find and print the Path of AEI arrays
file_paths = glob.glob(os.path.join(AEI, '*.npy'))
array_AEI = {os.path.basename(f): np.load(f) for f in file_paths}
# print(array_dictAEI)
#find and print the Path of Areagrid arrays
file_paths = glob.glob(os.path.join(Areagrid, '*.npy'))
array_Area = {os.path.basename(f): np.load(f) for f in file_paths}
# print(array_Area)
def Barley (array_BarAH, array_AEI, array_Area, array):
    for x , y, z in zip(rray_BarAH, array_AEI, array_Area):
        print(x,y,z)
        bar_st_1= array.append(x*y/z)
        print("Barley step 1 is done")
        bar = []
        Barley(array_BarAH, array_AEI, array_Area,bar )```

```