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.ar
I still did it with Linspace because I prefer to stick to this command.
You can create like the following format: np.linspace(np.zeros(width)[0], np.full((1,width),-1)[0], height)
np.linspace(np.zeros(5)[0],np.full((1,5),-1)[0],5)
Output the following:
array([[ 0. , 0. , 0. , 0. , 0. ],
[-0.25, -0.25, -0.25, -0.25, -0.25],
[-0.5 , -0.5 , -0.5 , -0.5 , -0.5 ],
[-0.75, -0.75, -0.75, -0.75, -0.75],
[-1. , -1. , -1. , -1. , -1. ]])
Add .tranpose() then you get:
array([[ 0. , -0.25, -0.5 , -0.75, -1. ],
[ 0. , -0.25, -0.5 , -0.75, -1. ],
[ 0. , -0.25, -0.5 , -0.75, -1. ],
[ 0. , -0.25, -0.5 , -0.75, -1. ],
[ 0. , -0.25, -0.5 , -0.75, -1. ]])