I have an empty table with an integer type field, let us call it "field1"
I want to populate field1 with numbers ranging from 1-5, so that my table looks like this
OBJECTID FIELD1
1 1
2 2
3 3
4 4
5 5
I have come across this example - How To: Create sequential numbers in a field using Python in the Field Calculator
But do not know how to adapt it to fit my need.
Regards,
Similar question to In Field Calculator 1 To 9 Loop Numbers.
Pre-Logic Script Code:
from itertools import cycle
rot = cycle(range(1,6))
def next_number():
return next(rot)
Value:
next_number()