Back to Numerical Arrays (NumPy)
np.diagflat
Create a 2D array with the flattened input as a diagonal.
Syntax
np.diagflat(v, k?, options?)
Description
Create a 2D array with the flattened input as a diagonal.
Parameters
| Name | Description |
|---|---|
| v | - Input array, which will be flattened |
| k(optional) | - Diagonal to set (default: 0, main diagonal) |
| options(optional) | NDArrayOptions |
Returns
Promise<NDArray>