[Solved] Python How to fill an array arr[i, j] within a for loop that calculates the values that will be put into i and j


If I understand your question correctly, this should do the trick.

arr = []
for z in np.arange(0, 0.5, 0.01):

    Q = a + z
    t = b + z

    # here I would like to store Q and t in an array
    arr.append([t,Q])

for item in arr:
    i = item[0]
    j = item[1]

It creates a list called arr that stores lists of [Q,t] values.

3

solved Python How to fill an array arr[i, j] within a for loop that calculates the values that will be put into i and j