如何在pyspark中将csv文件转换为yaml文件

时间:2020-04-22 22:38:13

标签: pyspark yaml

我有一个这样的csv文件

"id","accreditation_body","score","max_score","has_score"
"251","NAAC","7.2","",""
"2026","NAAC","0","",""
"264","NAAC","3.02","",""

我想像使用pyspark一样将其转换为yaml文件

- id: '251'
  accreditation_body: NAAC
  score: '7.2'
  max_score: ''
  has_score: ''
- id: '2026'
  accreditation_body: NAAC
  score: '0'
  max_score: ''
  has_score: ''
- id: '264'
  accreditation_body: NAAC
  score: '3.02'
  max_score: ''
  has_score: ''

0 个答案:

没有答案