# dask.array.tri

### dask.array.tri(N, M=None, k=0, dtype=<class 'float'>, chunks='auto', \*, like=None)

An array with ones at and below the given diagonal and zeros elsewhere.

This docstring was copied from numpy.tri.

Some inconsistencies with the Dask version may exist.

* **Parameters:**
  **N**
  : Number of rows in the array.

  **M**
  : Number of columns in the array.
    By default, M is taken equal to N.

  **k**
  : The sub-diagonal at and below which the array is filled.
    k = 0 is the main diagonal, while k < 0 is below it,
    and k > 0 is above.  The default is 0.

  **dtype**
  : Data type of the returned array.  The default is float.

  **like**
  : > Reference object to allow the creation of arrays which are not
    > NumPy arrays. If an array-like passed in as `like` supports
    > the `__array_function__` protocol, the result will be defined
    > by it. In this case, it ensures the creation of an array object
    > compatible with that passed in via this argument.
    <br/>
    #### Versionadded
    Added in version 1.20.0.
* **Returns:**
  **tri**
  : Array with its lower triangle filled with ones and zero elsewhere;
    in other words `T[i,j] == 1` for `j <= i + k`, 0 otherwise.

### Examples

```pycon
>>> import numpy as np
>>> np.tri(3, 5, 2, dtype=np.int_)
array([[1, 1, 1, 0, 0],
       [1, 1, 1, 1, 0],
       [1, 1, 1, 1, 1]])
```

```pycon
>>> np.tri(3, 5, -1)
array([[0.,  0.,  0.,  0.,  0.],
       [1.,  0.,  0.,  0.,  0.],
       [1.,  1.,  0.,  0.,  0.]])
```

<!-- !! processed by numpydoc !! -->
