All you have to do is change
head[0][0:]
to
head[:, 0] = 16
If you want to change the first line you can simply do:
head[0, :] = 16
EDIT:
Just in case, you also wonder how you can change an arbitrary number of values ββin an arbitrary row / column:
myArray = np.zeros((6, 6))
Now we set line 2 3 to 16:
myArray[2, 1:4] = 16. array([[ 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0.], [ 0., 16., 16., 16., 0., 0.], [ 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0.]])
The same thing works for columns:
myArray[2:5, 4] = -4. array([[ 0., 0., 0., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0.], [ 0., 16., 16., 16., -4., 0.], [ 0., 0., 0., 0., -4., 0.], [ 0., 0., 0., 0., -4., 0.], [ 0., 0., 0., 0., 0., 0.]])
And if you also want to change certain values, for example. two different lines, at the same time you can do it like this:
myArray[[0, 5], 0:3] = 10. array([[ 10., 10., 10., 0., 0., 0.], [ 0., 0., 0., 0., 0., 0.], [ 0., 16., 16., 16., -4., 0.], [ 0., 0., 0., 0., -4., 0.], [ 0., 0., 0., 0., -4., 0.], [ 10., 10., 10., 0., 0., 0.]])