If I understand your question correctly, I would suggest using a python generator in combination with an
arcpy.da.UpdateCursor First you would define your generator function. Something like this:
num = 0
for i in xrange(n):
while num < n:
num += 1
Then you can use an
update cursor like this to update the proper field with the value generated by the function/generator above:
in_feature_class = r'C:\path_to_data\your_data.shp'
field_to_update = 'the_field'
number_of_records = arcpy.GetCount_management(in_feature_class)
unique_values = get_unique_identifier(number_of_records)
with arcpy.da.UpdateCursor(in_feature_class, field_to_update) as u_cur:
for row in u_cur:
row = unique_values.next()
This is a quick go and there are certainly things that could be improved upon. If the order in which these fields are updated matters you may want to utilize an
ORDER BY field in the
sql_clause when creating your update cursor so that you update the values in the sorted order that you want. However this should get you on your way.