I was running a loop, from where I obtained ( 4 by 4) arrays, and now I want to insert zeros at certain locations in these arrays and turn them into (6 by 6) arrays.
I want to add zeros in third and sixth row , and also 3rd and sixth column
a_obtained = np.array( [[1, 2, 3, 4 ],
[5, 6, 7, 8 ],
[9, 10, 11, 12 ],
[13, 14, 15, 16 ]])
I tried going through np.vstack, np.hstack, but I am not able to place the zeros at specified locations.
a_desired = result = np.array([[1, 2, 0, 3, 4, 0 ],
[5, 6, 0, 7, 8, 0 ],
[0, 0, 0, 0, 0, 0 ],
[9, 10, 0, 11, 12, 0 ],
[13, 14, 0, 15, 6, 0 ],
[0, 0, 0, 0, 0, 0 ]])