Screen Link:
https://app.dataquest.io/c/108/m/562/stacks/7/lcsc-implementation
My Code:
while num_processes_done < processes.shape[0]:
# Step 1 goes here
if cur_pid != None and processes.loc[cur_pid,“Start”] + processes.loc[cur_pid, ‘Duration’] == cur_time:
cur_pid=None
num_processes_done += 1
# Step 2 goes here
ready_processes = processes[processes['Arrival']==cur_time]
for pid in ready_processes.iterrows():
wait_stack.push(pid)
# Step 3 goes here
if cur_pid == None and len(wait_stack) > 0:
cur_pid = wait_stack.pop()
processes.loc[cur_pid,"Start"] = cur_time
cur_time += 1
Replace this line with your code
What I expected to happen:
In the sample answer, there is a line
for pid, _ in ready_processes.iterrows():
what does the underscore refer to here? why deleting it will cause the error
‘Series’ objects are mutable, thus they cannot be hashed
Replace this line with the output/error
‘Series’ objects are mutable, thus they cannot be hashed