mm.math.diag_part¶
- math.diag_part(k=0)¶
The array of the main diagonal of array.
- Parameters:
array (
ndarray
[Tuple
[int
,...
],Union
[TypeVar
(R
,float16
,float32
,float64
),TypeVar
(C
,complex64
,complex128
),TypeVar
(Z
,int16
,int32
,int64
),TypeVar
(N
,uint16
,uint32
,uint64
)]]) – The array to extract the main diagonal of.k (
int
) – The diagonal to extract.
- Return type:
ndarray
[Tuple
[int
,...
],Union
[TypeVar
(R
,float16
,float32
,float64
),TypeVar
(C
,complex64
,complex128
),TypeVar
(Z
,int16
,int32
,int64
),TypeVar
(N
,uint16
,uint32
,uint64
)]]- Returns:
The array of the main diagonal of
array
.
code/api/mrmustard.math.diag_part
Download Python script
Download Notebook
View on GitHub