dist(n) generates a (n x n) matrix of elements. Each element is the straight-line "distance" from either element [0, 0] or the element just beyond another corner, whichever is closest.
I'm trying to roll the rows and columns to get an array with distances from the centre point, but I'm unsure about how to do this in Python.
In IDL:
> print,Shift(dist(5),2,2)
2.82843 2.23607 2.00000 2.23607 2.82843
2.23607 1.41421 1.00000 1.41421 2.23607
2.00000 1.00000 0.000000 1.00000 2.00000
2.23607 1.41421 1.00000 1.41421 2.23607
2.82843 2.23607 2.00000 2.23607 2.82843