Did I find the right examples for you? yes no

# numpy.matlib.diag

All Samples(10)  |  Call(8)  |  Derive(0)  |  Import(2)

```

d_Delta_up = MAT.diag(Delta_up)
d_Xi_up = MAT.diag(Xi_up)
Xi_eigval = MAT.zeros(N.shape(Delta_up))
```
```        gg = self.G
count = 0
for varia in MAT.diag(sigma):
if locals().has_key('ranvec'):
if count in indx:
```
```        if shockvec == None:
count = 0
for varia in MAT.diag(sigma):
if locals().has_key('ranvec'):
if count in indx:
```

```from numpy import mat, c_, r_, where, sqrt, newaxis
from numpy.linalg import solve
from numpy.matlib import diag
import sys

```
```def qzdiv(stake, A2, B2, Q, Z):
Aout = A2.copy(); Bout = B2.copy(); Qout = Q.copy(); Zout = Z.copy()
n, jnk = A2.shape
# remember diag returns 1d
root = mat(abs(c_[diag(A2)[:,newaxis], diag(B2)[:,newaxis]]))
```

```from numpy import mat, c_, r_, where, sqrt, newaxis
from numpy.linalg import solve
from numpy.matlib import diag
import sys

```
```def qzdiv(stake, A2, B2, Q, Z):
Aout = A2.copy(); Bout = B2.copy(); Qout = Q.copy(); Zout = Z.copy()
n, jnk = A2.shape
# remember diag returns 1d
root = mat(abs(c_[diag(A2)[:,newaxis], diag(B2)[:,newaxis]]))
```