May-19-2020, 01:17 PM
Dear all,
So for a homework assignment, I have trouble manipulating a 3D array (26,26,500). From the 300th element in the last row, all values should be turned into zeros. How should I go about this? I've tried working with for loops, but its not going well. I've included a snippet of the code. data_dir is the 3D array.
So for a homework assignment, I have trouble manipulating a 3D array (26,26,500). From the 300th element in the last row, all values should be turned into zeros. How should I go about this? I've tried working with for loops, but its not going well. I've included a snippet of the code. data_dir is the 3D array.
I=300 for i in range(500-I): data_dir[:,:,(500-i):]=0