I have a YAML file that goes as (just an example):
a:
b: 1
a:
b: 2
c: 1
a:
b: 3
I want to read this file, and do some stuff with bs and cs. The problem is that I can't read this file as a dictionary using yaml.load(), since it will only give me {'a':{'b': 3 }}. Instead, I want to read it as a list of dictionaries, i.e, I want the output to be something like:
[
{'a':{'b': 1 }},
{'a':{'b': 2, 'c': 1 }},
{'a':{'b': 3 }}
]
How can I achieve this? Thanks...