I have nested dictionary like this one:
results={
0: {'id': 87535653, 'cc': 0, 'cover': 89, 'grid': 'VQ'},
1: {'id': 31213450, 'cc': 0, 'cover': 99, 'grid': 'VQ'},
2: {'id': 22343446, 'cc': 0.1, 'cover': 79, 'grid': 'VP'},
3: {'id': 34568756, 'cc': 0, 'cover': 34, 'grid': 'VQ'},
4: {'id': 43532251, 'cc': 0.2, 'cover': 78, 'grid': 'DS'},
5: {'id': 42532376, 'cc': 23, 'cover': 90, 'grid': 'ZF'},
}
What I want is to get only the first item of any content in grid. So, for this example I want to get back this:
results={
0: {'id': 87535653, 'cc': 0, 'cover': 89, 'grid': 'VQ'},
2: {'id': 22343446, 'cc': 0.1, 'cover': 79, 'grid': 'VP'},
4: {'id': 43532251, 'cc': 0.2, 'cover': 78, 'grid': 'DS'},
5: {'id': 42532376, 'cc': 23, 'cover': 90, 'grid': 'ZF'},
}
The challenge: I don't know the content in Grid before. That is, anything can be in there and I can't iterate according to the specific content. The code has to recognize independently that this is an item that does not yet exist with this content.
How can I iterate over the files to get the result I want?