I know this might be a silly question. But on this notebook there is the following piece of code:
import random
assignments_to_add = []
for _, row in routes.iterrows():
worker = random.choice(workers)
workers.remove(worker)
route_stops = stops.loc[(stops['RouteName'] == row["RouteName"]) & stops['globalid'].notnull()]
for _, stop in route_stops.iterrows():
assignments_to_add.append(workforce.Assignment(
project,
assignment_type="Inspection",
location=stop["name"],
status="assigned",
worker=worker,
assigned_date=datetime.now(),
due_date=stop["DepartTime"],
geometry=stop["SHAPE"]
))
assignments = project.assignments.batch_add(assignments_to_add)
The workers in worker = random.choice(workers)
is a list. So, I cant find the way to not make it random
. I want the code to pick the item of the list in order as it is on the list. How could I do this?
Thanks