# Iterating array like numpy?

**URL:** <https://discourse.julialang.org/t/iterating-array-like-numpy/15059>\
**Category:** General Usage\
**Tags:** question\
**Created:** [September 17, 2018, 11:39am UTC](https://discourse.julialang.org/t/iterating-array-like-numpy/15059 "2018-09-17T11:39:52Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Tamas\_Papp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamas_papp/32/25949_2.png) [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Post date:** [September 17, 2018, 12:05pm UTC](https://discourse.julialang.org/t/iterating-array-like-numpy/15059/2 "2018-09-17T12:05:29Z")

</div>

Does this help?

```julia
julia> A = rand(1:10, 3, 2)
3×2 Array{Int64,2}:
 2 9
 1 8
 3 3

julia> for rowindex in axes(A, 1)
       @show A[rowindex, :]
       end
A[rowindex, :] = [2, 9]
A[rowindex, :] = [1, 8]
A[rowindex, :] = [3, 3]

```

You can use a `@view` to speed things up in some cases (benchmark!).

If you need an actual iterable for the rows (or their views), that is also easy, just ask.

---

_[View the full topic](https://discourse.julialang.org/t/iterating-array-like-numpy/15059)._
