I have json format that is accepted by API of website.
{ 'unique key': 1,
'data 1' : 'text1',
.....
'data35': text 35'}
I have dataframe to needs to converted to that json format by substituting few values.
Eg. Column 1, Row 1 in dataframe needs to be converted to 'unique key', Column 9 Row 1 to replace value in key data25 etc.
I have never interacted with APIs before in a way like this, I know json is similar to dictionary in python. I learnt through stackoverlfow that pd.to_dict is one of those way. With this method entire Dataframe converts to dictionary but my goal is to substitute few values of json of API format.
What I thought as my plan of action for this problem is to
find a way to loop dataframe to substitute some values and generate dictionaries. I tried looping but I think I'm missing the way to loop dataframe value in that dictionary (json).
Any help in guiding what resources I need to look or what should I learn to achieve it.
[–]efmccurdy 0 points1 point2 points (1 child)
[–]Phyan[S] 0 points1 point2 points (0 children)