Quantcast
Channel: Question and Answer » arcpy
Viewing all articles
Browse latest Browse all 767

CalculateField_management: Different results than in the field calculator

$
0
0

I`m using ArcMap 10.2.2 and Python 2.7.5

I´m tryig to calculate values with the CalculateField_management tool.

my script:

def mthree(mthre, mtwo):
    if mthre >= 1:
        return -3
    if mtwo >= 2:
        return -5
    else:
        return None

try:
    arcpy.CalculateField_management(FC, "EPK_Gesamt", mthree("countmd","countmz"),"PYTHON_9.3")
    print "done"   

The Problem:
It writes in every row the same value (-3)
However if I do the same calculation within the Field Calculator it works great!
Has anyone an Idea what I´m doing wrong?


Viewing all articles
Browse latest Browse all 767

Trending Articles