0
waiting = [[0]]* 5 # we can assume the waiting to contain 5 lists
print((np.shape(waiting))) # (5, 1)
waiting[0][0] = waiting[0][0] + (0.72) # only the value at the first list should get changed
print(waiting) # [[0.72], [0.72], [0.72], [0.72], [0.72]] when I expected only the first list's 0 
                # to become 0.72

As explained in the comments, why is all of the array getting affected by the 3rd line waiting[0][0] = waiting[0][0] + (0.72)

user3656142
  • 437
  • 3
  • 14

0 Answers0