I have the following python code that outputs:
# Somecode block before
#####################
print np.shape(data2['sac']['startx'][0][0])
print np.shape(startx_buff)
# New Completed Assignment
data2['sac']['startx'][0][0][0] = startx_buff
#**shape of data2['sac']['startx'][0][0] = (2, 119, 20)**
#**shape of startx_buff = (2,120,20)**
#***Error: data2['sac']['startx'][0][0][0] = startx_buff
ValueError: could not broadcast input array from shape (2,120,20) into shape (119,20)***
And I'd essentially like to overwrite the data2['sac']['startx'][0][0] entry to have the (2,120,20) dimensions (as well as the values of startx_buff). The reason: After post-processing I noticed an entry value was missing. In MATLAB this is no problem since it is more flexible, and I can potentially redefine a variable by assigning it a new value, and array/cell shape. But other things I've tried in python for a workaround doesnt' work is:
del data2['sac']['startx'][0][0]
data2['sac']['startx'][0][0] = np.empty((2,120,20))
#Error: won't let me delete all the values in the array
I'm not quite sure what the solution is, or even under what to look for online (I tried looking for overwriting/overloading array size). Besides finding the answer to this problem, what would be the correct terminology for this issue?