How to do this stuff in python pandas? I am trying to make put request to some API and not sure how to generate request body since I have the csv file only . Request body asks for fixed set of schema
Advertisement
Answer
Dataframe has a function to_dict
.
documents = df.to_dict(orient='records') result = {'items': documents}