I'm trying to assess the compactness of Virginia's congressional districts using the Polsby-Popper measure (4π (Area/Perimeter^2)), with this being my input into the code block:

import math
def PolPop(area, peri):
    PolPop = (4*math.pi)*(area/(peri**2))

but I keep getting the error

ERROR 000539: Traceback (most recent call last):
  File "<expression>", line 1, in <module>
TypeError: PolPop() missing 1 required positional argument: 'peri'

I know that I'm missing something from the equation, but I can't seem to figure out what it is.

  • Can you post a screen shot of what the Field Calculator looks like? – Bjorn Feb 14 at 21:59
  • I actually ended up figuring it out! – Keelin Feb 14 at 22:05
  • The code block ended up being what I originally inputted, I just incorrectly input the fields in the main Field Calculator expression. – Keelin Feb 14 at 22:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.