I have a dataframe like this
| A | B | tc-01 | tc-02 |
|---|---|---|---|
| bapc | act | 1 | 1 |
| bapc | bp | 2 | 2 |
| bapc | ly | 3 | 3 |
| bapc | vsLy | 4 | 4 |
| bapc | bsBp | 5 | 5 |
| nsr | act | 6 | 6 |
| nsr | bp | 7 | 7 |
| nsr | ly | 8 | 8 |
| nsr | vsLy | 9 | 9 |
| nsr | bsBp | 10 | 10 |
How can I export dataframe to the json file like this
{
"expect": {
"tc-01": {
"bapc":{
"act":1,
"bp":2,
"ly":3,
"vsLy":4,
"bsBp":5
},
"nsr":{
"act":6,
"bp":7,
"ly":8,
"vsLy":9,
"bsBp":10
}
},
"tc-02": {
"bapc":{
"act":1,
"bp":2,
"ly":3,
"vsLy":4,
"bsBp":5
},
"nsr":{
"act":6,
"bp":7,
"ly":8,
"vsLy":9,
"bsBp":10
}
}
}
}