I need to loop through two matrixes, but I can't use Numpy, I'm asked not to use it.
altura_mar = [[1,5,7],
[3,2,31]]
precipitacion_anual = [[10,5,70],
[5,7,8]]
for marIndex, anualIndex in zip(altura_mar, precipitacion_anual):
#some code
so, my problem here is that zip works with just a list not a 2d list if I try to use it with a matrix it gives this error:"ValueError: too many values to unpack (expected 2)"
Now I'm thinking of two possible solutions:
- Make the multidimensional list into a single list like altura_mar = [1,5,7,3,2,31] but how could I do that?
- Work with the 2 matrixes as they are in a nested for loop (I don't know about this, but maybe you guys can help here).