How to convert the row-wise data of dataframe with its column name as key and row data as value in json using python

后端 未结 3 1258
没有蜡笔的小新
没有蜡笔的小新 2021-01-27 16:16

I am having the issue in converting the row-wise data of dataframe with the column name as key and row data as value. I want to pass this row-wise json to another API a

3条回答
  •  臣服心动
    2021-01-27 17:18

    you can try this hope it will work:

    import pandas as pd
    df = pd.read_csv(your file path)
    df.to_json()
    

提交回复
热议问题