I would like a list of 2d NumPy arrays (x,y) , where each x is in {-5, -4.5, -4, -3.5, ..., 3.5, 4, 4.5, 5} and the same for y.
I could do
x = np.arange(-5, 5.1, 0.5)
y = np.arange(-5, 5.1, 0.5)
and then iterate through all possible pairs, but I'm sure there's a nicer way...
I would like something back that looks like:
[[-5, -5],
[-5, -4.5],
[-5, -4],
...
[5, 5]]
but the order does not matter.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…