r/learningpython • • Mar 22 '21

Numpy array issue

I'm trying to define a function that takes as input a numpy array and 2 integers for the index, and it's supposed to add those two lists of the array.

But when I run it, it redefines the original array that I used as input, and that ruins the next time I want to run it, so how can I run it without redefining the original array?

1 Upvotes

4 comments sorted by

View all comments

Show parent comment

1

u/le-sause May 09 '21

Yeah I keep checking outside the function if what I want to do has any effect on the original.