Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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?

Ivano

share|improve this question
1  
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
2  
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
add comment

1 Answer 1

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
add comment

Your Answer

 
discard

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.