假设我有yml格式的数据:
testdata:
- name: others
marks:
- subject: physics
marks: 60
- name: midterm
marks: []
- name: final
marks:
- subject: math
mark: 70
- subject: chemistry
mark: 80
我需要的是
[]
期望的输出:
[
{ subject: physics
marks: 60
},
{ subject: math
mark: 70
},
{ subject: chemistry
mark: 80
}
]
请帮帮我