Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Calculate Values problems

$
0
0
I am trying to write a script to calculate values if there are null values in a table however it never calculates any values and I am pretty sure my code is right.
Where (Operator) is a field with values and null values
and (PointID) is a field with coded values and the Operator name as a 3 letter code stored within the text.

Code:


Expression:
Calc (!Operator!)

Code Block:
def Calc (Operator):
  while (Operator is null):
    if (re.search ("DWS", PointID) is TRUE):
      return "Don"
    elif (re.search ("GMS", PointID) is TRUE):
      return "Gordon"
    elif (re.search ("JZL", PointID) is TRUE):
      return "Julian"
    elif (re.search ("AWM", PointID) is TRUE):
      return "Anthony"
    else return (Operator)


Viewing all articles
Browse latest Browse all 2485

Trending Articles