Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to make a simple field calculation with ArcGIS 9.3:

New field = Old field - Old field(first value)

which in Calculate Field with python code should be

Expression: !Old field! - first

Code Block: list= [AngOriz] first = list[0]

The error is ERROR 000539: Runtime error : name 'AngOriz' is not defined Failed to execute (Calculate Field).

How could I tranform a column field into a list?


share|improve this question
Have you thought about using an update cursor to iterate through your rows and calculate your new field that way? – Jason Jul 27 '11 at 14:33
I'm having a bear of a time understanding this. Could you give us a sample of the data and explain what the calculation should result in if it works properly? – Nathanus Jul 27 '11 at 15:37

I'm not certain I understand the problem, but I asked a question here previously about the syntax when using the Python Codeblock. The key misunderstanding I had was that you need to pass in your field names as arguments to the code block. Here is a small example:

enter image description here

and the corresponding part of the attribute table:

enter image description here

In your case, I think the easiest thing would be to make a new field with the value from Old field(first value), and then use that for the calculation. This would not require putting python in the codeblock.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.