Why is python sorting an array I'm not asking it to sort, and how do I get it to stop?
For example, I have an NumPy array A:
A = np.array[4, 7, 1, 3, 2], [3, 2, 4, 2, 1]
I wish to sort this array, but preserve its original structure so I can index it later. So my idea was to make a copy of the array and sort the copy:
B = A
B.sort()
Why is it then, that when I print A after this sort command, it prints the sorted array? Even though I never called sort on it?
print(a)
[[1 2 3 4 7]
[1 2 2 3 4]]
Is there a way around this?