How to assign the diagonal elements of part of matrix to a value?

Not very elegant but you could do a comprehension:

  [aa[ind...] = 1 for ind in zip(5:7,4:6)]

It could be very clearly (and with better performance) written with a for loop as well.