0

I need help understanding how to iterate values in a fixed array. I don't know if there is a function in numpy that does it for you. To better understand my question, here is an example. I have a fixed array of 10.

[0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[1, 0, 0, 0, 0, 0, 0, 0, 0, 0]
[9, 1, 0, 0, 0, 0, 0, 0, 0, 0]
[42, 9, 1, 0, 0, 0, 0, 0, 0, 0]
.
.
.
[37, 15, 20, 60, 39, 10, 5, 3, 42, 9]

Once I hit index 10, the first value 1 disappears from the array.

Can someone tell me the proper name for this technique and if there is a built-in function?

Barmar
  • 741,623
  • 53
  • 500
  • 612
uBoscuBo
  • 81
  • 8
  • How do you insert values into array? Or you just need insert() function that does shift of all values and than inserts a new one ? – Yaroslav Kornachevskyi Aug 05 '21 at 18:31
  • I think if you use the `insert()` function, you are also expanding the shape of the array. If I want my array to be fixed, I don't think it will work, right? I will try it out right now. – uBoscuBo Aug 05 '21 at 18:36

0 Answers0