How to add a dataframe row in a field array Like i have my data frame.
import pandas as pd
inp = [{'c1':10, 'c2':100}, {'c1':11,'c2':110}, {'c1':12,'c2':120}]
df = pd.DataFrame(inp)
print df
Output:
c1 c2
0 10 100
1 11 110
2 12 120
So i want to have something like this :
{
"fields": {
"c1": 10,
"c2": 100,
}
},
{
"fields": {
"c1": 11,
"c2": 110,
}
},
{
"fields": {
"c1": 12,
"c2": 120,
}
}
How can i do it ?