Convert Nested Dictionary to CSV Table

后端 未结 3 1220
鱼传尺愫
鱼传尺愫 2020-12-19 23:30

I\'m going through a data mining tutorial and I\'m using the following dictionary.

users = {
    \"Angelica\": {
        \"Blues Traveler\": 3.5, 
        \"         


        
3条回答
  •  猫巷女王i
    2020-12-20 00:01

    import pandas as pd
    data = pd.DataFrame(users)
    data = data.fillna("-")
    data.to_csv("./users.csv")
    

提交回复
热议问题