Hi all, I need to set all items in a dict to a new dict if the key != '_id'. I thought this would work (the dicts are in a list btw)
newl=[]
for index, x in enumerate(listofdict):
newl[index]=dict((key, value) for key, value in x.items() if key != '_id')
but I get a list index out of range. Why is that? If I print(index) it's correct.