I have some arrays of data that I'd like to perform similar calculations on so I want to iterate through them based off of their names. Some pseudo code for example:
l = 1000 # example length of data arrays
n = 3 # number of arrays
data_1 = [1] * l
data_2 = [2] * l
data_3 = [3] * l
# l can vary in size, so arrays aren't fixed length
for i in range(n):
for j in range(l):
data_[i][j] = some_length_based_maths[j]
It's the syntax of calling the data arrays by their name in an iterative way that's throwing me off.
I probably should use a 2D array or something and call the elements [i][j]
, but it's easier to keep it all separate in this application if possible.
Thanks!