I have 2 single-dimensional NumPy arrays
a = np.array([0, 4])
b = np.array([3, 2])
I want to create a 2d array of numbers
c = np.array([[0,1,2], [4,5]])
I can also create this using a for loop
EDIT: Updating loop based on @jtwalters comments
c = np.zeros(b.shape[0], dtype=object)
for i in range(b.shape[0]):
c[i] = np.arange(a[i], a[i]+b[i])
How can I achieve this via vectorization/broadcasting?