Export data from yaml format to Excel

This image shows my data in .yaml format. I want to export in column

Topic numpy python

Category Data Science


Something like:

import yaml
import pandas as pd

data = """
thermal_properties:
- temp: 0.0
  free_energy: 10

- temp: 1.0
  free_energy: 11

- temp: 2.0
  free_energy: 12
"""
x = yaml.load(data)

pd.DataFrame(x['thermal_properties']).to_excel('file.xlsx')

should do the job.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.