Spelling of "dimension".
I suggest using ```arr.ndim``` instead of ```len(arr.shape)```.
I also prefer the good old percent formatting for things like this.  More concise, more readable.