Ok, I'm stuck, I need help here ...
If I have a main dictionary, for example:
data = [ {"key1": "value1", "key2": "value2", "key1": "value3"},
{"key1": "value4", "key2": "value5", "key1": "value6"},
{"key1": "value1", "key2": "value8", "key1": "value9"} ]
Now I need to go through this dictionary to format some data, for example:
for datadict in data:
for key, value in datadict.items():
...filter the data...
Now, as if I were in the same cycle somehow (if possible ... if not, suggest alternatives, please) check the values of certain keys, and if these values correspond to my presets, I would add that the whole list in another dictionary, thereby effectively creating smaller dictionaries when I exit this main dictionary based on certain keys and values?
, , - , key1 "value1", - :
subdata = [ {"key1": "value1", "key2": "value2", "key1": "value3"},
{"key1": "value1", "key2": "value8", "key1": "value9"} ]