1
a=np.linspace(0.03,0.05,5)
b=np.linspace(-0.01,0.01,200)
c= []

for i in np.arange(a[0],a[4]): #first for loop to print a
    for j in range(b[0],b[199]):   #second for loop to print b
       print j
print i

#But I am not getting correct values as 5 values for i and 200 values for j. Getting only 1 values printed.

1 Answers1

0

Not quite sure what you are trying to achieve with this, but the last row should be indented. One solution for printing the arrays in the format "element in array a then all the elements from array b" is presented below.

a = np.linspace(0.03,0.05,5)
b = np.linspace(-0.01,0.01,200)
c = []

for i in a:      # first for loop to print a
    print i
    for j in b:  # second for loop to print b
       print j
kaarre
  • 51
  • 4