I am using panel datastructure in pandas for storing a 3d panel.
T=pd.Panel(data=np.zeros((n1,n2,n3)),items=n1_label, major_axis=n2_label, minor_axis=n3_label)
Later on, I am trying to update (increment) the values stored at individual locations inside a loop. Currently I am doing:
u=T.get_value(n1_loop,n2_loop,n3_loop)
T.set_value(n1_loop,n2_loop,n3_loop,u+1)
My question- is this the simplest way? Is there any other simpler way? The following dont work:
T[n1_loop,n2_loop,n3_loop] +=1
or
T[n1_loop,n2_loop,n3_loop] = T[n1_loop,n2_loop,n3_loop] +1