Reputation: 47
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
Upvotes: 0
Views: 37
Reputation: 414
Dataframe has a function to_dict
.
documents = df.to_dict(orient='records')
result = {'items': documents}
Upvotes: 1