Interesting article but just skimming through it some things stand out immediately:
1.) The first snippet isn't even valid python code as floats don't have a shape attribute.
s = 0.
n = s.shape
2.) The inline latex math isn't rendered properly.