I have the following dataframe:
df = pd.DataFrame([{'answers': ['No'], 'questionId': 'applicationSubmitted'}, {'answers': ['NOT_READY_TO_ENROLL'], 'questionId': 'status'}, {'answers': ['Intro'], 'questionId': 'salesProcessReached'}, {'answers': [True], 'questionId': 'noTimeToCoverCurrentPlan'}, {'answers': [''], 'questionId': 'currentPlan'}, {'answers': ['No'], 'questionId': 'scheduleFollowUp'}])
Upon applying pivot function df.pivot(columns='questionId')
, i get the following table:
How can I tweak the pivot to have only 1 row show up for all answers, with only 1 row for headers instead of two.
Thank you