python - Flatten nested pandas dataframe -


i'm wondering how flatten nested pandas dataframe demonstrated in picture attached. enter image description here

the nested attribute given 'data' field. in short: have list of participants (denoted 'participant_id') , submitted responses ('data') @ different times. need create wide dataframe, each participant @ each time stamp there row of records of data ('q1', 'q2',...,'summary')

many in advance!

try this:

pd.concat([df.data.apply(pd.series), df.drop('data', axis=1)], axis=1) 

Comments

Popular posts from this blog

jOOQ update returning clause with Oracle -

java - Warning equals/hashCode on @Data annotation lombok with inheritance -

java - BasicPathUsageException: Cannot join to attribute of basic type -