I am struggling with pandas to get the results per below. Can you pls help me on this?
Here is a code:
response =[{'type': 'heartrate',
'data': [27, 32, 35, 31, 29, 30],
'education': 'bachelor',
'salary': 80000}].
df = pd.DataFrame(response)
What I got.
type data education salary
0 heartrate [27, 32, 35, 31, 29, 30] bachelor 80000
What I want to achieve:
type data education salary
0 heartrate 27 bachelor 80000
1 heartrate 32 bachelor 80000
2 heartrate 35 bachelor 80000
3 heartrate 31 bachelor 80000
4 heartrate 29 bachelor 80000
5 heartrate 30 bachelor 80000
Note: I found out that it will work if I remove square brackets, but this is actually api response hence cannot modify the original data.