Hi,
I need to calculate a set of unique identifiers that goes sequentially based off the zip code in another field. For example, if the zip code is 77059 I need it to take that number and in the Unique Identifier column I created output 77059.001, then 77059.002 etc. until it gets to the next zip code, and start again. I.e., if 77064 is next, it needs to call that number and start back at 77064.001. This is what I have so far but obviously it doesn't call in the field !ZipCode!, and that's what I've been struggling with. If someone could help with this it would be greatly appreciated.
# Calculates a sequential number
# More calculator examples at esriurl.com/CalculatorExamples
import arcpy
rec=0
def SequentialNumber():
global rec
pStart = 77041
pInterval = .001
if (rec == 0):
rec = pStart
else:
rec = rec + pInterval
return f"{round(rec, 3):.3f}"
Also, its been struggling to output 3 decimals after it gets to .009 for example, it outputs 0.01 and I need it in 3 decimals. Someone else suggested the return f"{round(rec, 3):.3f}" code, but it seems to only work at times.
Noah