m = np.random.randint(4,size=(4,4,4))
Let's say I want to create separate arrays for each integer like this
mm=[]
mm.append((m==1).astype(int))
mm.append((m==2).astype(int))
mm.append((m==3).astype(int))
I was wondering if there is a better way to do this without having to explicitly define m==1, etc. Is it possible to implement an implicit expansion approach in python as easily as it is in Matlab for multidimensional arrays as shown in this post?