I have a numpy ndarray a = np.ndarray((3,3))
and I want all of the indexes to start at the same value, e.g. 5:
array([[5., 5., 5.],
[5., 5., 5.],
[5., 5., 5.]])
Note: I'm posting this Q&A style because every time I look this up I always find a bunch of random questions about complex slicing, but not a simple example of casting everything at once. Hopefully this will pop up as a more immediate result next time I search this question. But I also hope that others have good ideas I can adopt.