求问各位大佬怎么用python获取排序后二维列表在原列表中的下标,我的代码是这样的,但是报错了

g = [0] * len(machine)
for i in machine:
g[i] = [0] * len(time_slot)

for i in machine:
g[i] = c[i]

print(g)

for i in machine:
c[i].sort()

print(c)

cost_index = [0] * len(machine)
for i in machine:
cost_index = [0] * len(time_slot)

for i in machine:
for k in time_slot:
cost_index[i][k] = g[i].index(c[i][k])

print(cost_index)

cost_index = [0] * len(time_slot) 这一行写错了 应该是 cost_index i]= [0] * len(time_slot)