# What is the Julian equivalent of Python's \`np.eye(5, 5, 1)\`

**URL:** <https://discourse.julialang.org/t/what-is-the-julian-equivalent-of-pythons-np-eye-5-5-1/98746>\
**Category:** New to Julia\
**Tags:** linearalgebra, python\
**Created:** [May 12, 2023, 2:53pm UTC](https://discourse.julialang.org/t/what-is-the-julian-equivalent-of-pythons-np-eye-5-5-1/98746 "2023-05-12T14:53:12Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [May 12, 2023, 2:56pm UTC](https://discourse.julialang.org/t/what-is-the-julian-equivalent-of-pythons-np-eye-5-5-1/98746/2 "2023-05-12T14:56:04Z")

</div>

It’s `I` in the `LinearAlgebra` standard library:

```julia
In [1]: using LinearAlgebra

In [2]: I(5)
5×5 Diagonal{Bool, Vector{Bool}}:
 1 ⋅ ⋅ ⋅ ⋅
 ⋅ 1 ⋅ ⋅ ⋅
 ⋅ ⋅ 1 ⋅ ⋅
 ⋅ ⋅ ⋅ 1 ⋅
 ⋅ ⋅ ⋅ ⋅ 1

```

---

_[View the full topic](https://discourse.julialang.org/t/what-is-the-julian-equivalent-of-pythons-np-eye-5-5-1/98746)._
