I want to do essentially what this person is doing but in 3D:
How can I add small 2D array to larger array?
Currently I am generated a large empty numpy array:
BigArray = np.zeros((2048,2048,1000), np.float16)
Then I am trying to add data into this array using the method shown in the stackoverflow question I linked.
The array I want to add is a smaller numpy array of 100,100,100 dimensions and the locations are given in a list of X,Y,Z coords that define the centre. Therefore my code reads as follows:
SmallArray = np.random.random((100,100,100))
X = 1000
Y = 1000
Z = 500
BigArray([X-49:Y+50, Y-49:Y+50, Z-49:Z+50]) = SmallArray
However I am getting an error that the first colon is a syntax error and I am not sure why.
Any and all help is much appreciated, thank you.
edit: typos.
zeroesis not a function ofnumpy, you must meannp.zerosBigArray([X-49:Y+50, Y-49:Y+50, Z-49:Z+50]): definitely remove the(and).