Is there a better way to create a multidimensional array in numpy using a FOR loop, rather than creating a list? This is the only method I could come up with:
import numpy as np
a = []
for x in range(1,6):
for y in range(1,6):
a.append([x,y])
a = np.array(a)
print(f'Type(a) = {type(a)}. a = {a}')
EDIT: I tried doing something like this:
a = np.array([range(1,6),range(1,6)])
a.shape = (5,2)
print(f'Type(a) = {type(a)}. a = {a}')
however, the output is not the same. I'm sure I'm missing something basic.