use numpy.diag instead