You need to create the copy of the object. You may do it using numpy.copy() since you are having numpy object. Hence, your initialisation should be like:
imageEdited_3d = imageOriginal_3d.copy()
Also there is copy module for creating the deep copy OR, shallow copy. This works independent of object type. For example, your code using copy should be as:
from copy import copy, deepcopy
# Creates shallow copy of object
imageEdited_3d = copy(imageOriginal_3d)
# Creates deep copy of object
imageEdited_3d = deepcopy(imageOriginal_3d)
Description:
Answer from Moinuddin Quadri on Stack OverflowA shallow copy constructs a new compound object and then (to the extent possible) inserts references into it to the objects found in the original.
A deep copy constructs a new compound object and then, recursively, inserts copies into it of the objects found in the original.
NumPy
numpy.org โบ doc โบ stable โบ reference โบ generated โบ numpy.copy.html
numpy.copy โ NumPy v2.5 Manual
Return an array copy of the given object.
NumPy
numpy.org โบ devdocs โบ reference โบ generated โบ numpy.copy.html
numpy.copy โ NumPy v2.6.dev0 Manual
Return an array copy of the given object.
NumPy
numpy.org โบ doc โบ 2.2 โบ reference โบ generated โบ numpy.copy.html
numpy.copy โ NumPy v2.2 Manual
Return an array copy of the given object.
NumPy
numpy.org โบ doc โบ stable โบ user โบ basics.copies.html
Copies and views โ NumPy v2.5 Manual
When a new array is created by duplicating the data buffer as well as the metadata, it is called a copy. Changes made to the copy do not reflect on the original array. Making a copy is slower and memory-consuming but sometimes necessary. A copy can be forced by using ndarray.copy.
Linux Hint
linuxhint.com โบ copy-array-python
Copy Array in Python โ Linux Hint
Create a Python file with the following script to know the way of copying an array without using any built-in function or assignment operator. Any loop can be used to copy the values of an array to another array. The โforโ loop has been used in the script to copy an array to another array.
NumPy
numpy.org โบ doc โบ 2.1 โบ reference โบ generated โบ numpy.copy.html
numpy.copy โ NumPy v2.1 Manual
Return an array copy of the given object.
NumPy
numpy.org โบ devdocs โบ user โบ basics.copies.html
Copies and views โ NumPy v2.6.dev0 Manual
When a new array is created by duplicating the data buffer as well as the metadata, it is called a copy. Changes made to the copy do not reflect on the original array. Making a copy is slower and memory-consuming but sometimes necessary. A copy can be forced by using ndarray.copy.
GeeksforGeeks
geeksforgeeks.org โบ python โบ numpy-copy-and-view
NumPy Copy and View of Array - GeeksforGeeks
January 14, 2026 - Explanation: A NumPy array arr is created and a view v is made using .view(). Though they have different IDs, they share the same data, so changes in arr (like arr[0] = 12) also appear in v. A copy creates a new, independent array with its own memory. Any change to the copied array wonโt affect the original one, and vice versa. This is useful when you want to modify data safely without touching the original.
NumPy
numpy.org โบ devdocs โบ reference โบ generated โบ numpy.ndarray.copy.html
numpy.ndarray.copy โ NumPy v2.6.dev0 Manual
To ensure all elements within an object array are copied, use copy.deepcopy:
NumPy
numpy.org โบ doc โบ 2.0 โบ user โบ basics.copies.html
Copies and views โ NumPy v2.0 Manual
When a new array is created by duplicating the data buffer as well as the metadata, it is called a copy. Changes made to the copy do not reflect on the original array. Making a copy is slower and memory-consuming but sometimes necessary. A copy can be forced by using ndarray.copy.
NumPy
numpy.org โบ doc โบ stable โบ reference โบ generated โบ numpy.copyto.html
numpy.copyto โ NumPy v2.5 Manual
>>> import numpy as np >>> A = np.array([4, 5, 6]) >>> B = [1, 2, 3] >>> np.copyto(A, B) >>> A array([1, 2, 3])
NumPy
numpy.org โบ doc โบ 2.1 โบ reference โบ generated โบ numpy.ndarray.copy.html
numpy.ndarray.copy โ NumPy v2.1 Manual
To ensure all elements within an object array are copied, use copy.deepcopy:
NumPy
numpy.org โบ doc โบ 2.1 โบ user โบ basics.copies.html
Copies and views โ NumPy v2.1 Manual
When a new array is created by duplicating the data buffer as well as the metadata, it is called a copy. Changes made to the copy do not reflect on the original array. Making a copy is slower and memory-consuming but sometimes necessary. A copy can be forced by using ndarray.copy.
NumPy
numpy.org โบ doc โบ 2.0 โบ reference โบ generated โบ numpy.copy.html
numpy.copy โ NumPy v2.0 Manual
Return an array copy of the given object.
GeeksforGeeks
geeksforgeeks.org โบ how-to-copy-numpy-array-into-another-array
How to Copy NumPy array into another array? - GeeksforGeeks
January 10, 2024 - Original array: [ 1.54 2.99 3.42 4.87 6.94 8.21 7.65 10.5 77.5 ] Copied array: [ 1.54 2.99 3.42 4.87 6.94 8.21 7.65 10.5 77.5 ] In this example, the given 2-D Numpy array 'org_array' is copied to another array 'copy_array' using np.copy () function.
Readthedocs
ecco-v4-python-tutorial.readthedocs.io โบ ECCO_v4_Operating_on_Numpy_Arrays.html
Operating on Numpy arrays โ ECCO Version 4 Python Tutorial 4.4.1 documentation
Operating on the right hand side of the assignment does indeed new arrays in memory leaving the original SSH numpy array untouched. A second way to have a new variable assignment not point to the original variable is to use the copy or deepcopy command.
NumPy
numpy.org โบ doc โบ 2.2 โบ reference โบ generated โบ numpy.ndarray.copy.html
numpy.ndarray.copy โ NumPy v2.2 Manual
The function numpy.copy is similar, but it defaults to using order โKโ, and will not pass sub-classes through by default. ... For arrays containing Python objects (e.g. dtype=object), the copy is a shallow one.