Hi everybody,
Im trying to create a new field which will start with the value 1201 and increment by 1 until the end (82 values).
I have tried to use the code block to make it create such field but couldn't make it..
help please? Tnx
Please create new field with "Double"
Value
raka()
Code Block
rec=0def raka():global recpStart = 1201pInterval = 1if (rec == 0):rec = pStartelse:rec += pIntervalreturn rec
You could use itertools.count
Expression:
next(counter)
Code block:
import itertools counter = itertools.count(start=1201)
!!!!!!!!!!!!! 🙂
tnx man.. worked!
cheers!
short and elegant. Do you recommend to study the itertools ?
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.