Conversion of YAML Data to Data Frame using yamltodb

前端 未结 1 1658
盖世英雄少女心
盖世英雄少女心 2021-01-22 02:38

I am Trying to convert the YAML Data to Data frame through pandas with yamltodb package. but it is showing only the single row enclosed with header and only one data is showing.

相关标签:
1条回答
  • 2021-01-22 03:03

    Just guessing, as I don’t know what your data actually looks like

    import pandas as pd
    import yaml
    
    with open('fName.yaml', 'r') as f:
        df = pd.io.json.json_normalize(yaml.load(f))
    
    df.head()
    
    0 讨论(0)
提交回复
热议问题