Absolute newbie ;)
Current Input (note that some of the input below relies on other code which I ran before this, not included here):
data = []
vid_list = list(primary_variants['vid'].unique())
for vid in vid_list:
report_info = get_reports_with_vid([vid]).rename(columns={"xe": "xe_id"})
og_rqs = report_info["rq"].apply(lambda x: x.split("-")[0])
report_info = report_info[og_rqs != 'RQ53']
vid_info = get_vid_warn_info(report_info[["xe_id", "vid"]].to_dict("records"))
vid_info = report_info.merge(vid_info, on=["xe_id", "vid"], how="left")
conf_status = dict(vid_info["confirmation_status"].value_counts())
data.append({'conf_status': conf_status})
df = pd.DataFrame(data)
print(df)
Current Output:
conf_status
0 {'confirmation_not_necessary': 16, 'might_need_confirmation': 2}
1 {'confirmation_not_necessary': 1}
2 {'confirmation_not_necessary': 3}
3 {'confirmation_not_necessary': 6}
4 {'confident_call': 2}
5 {'confirmation_not_necessary': 1791, 'might_need_confirmation': 48}
Question: Ideally, I really want rearrange the dataframe output like this (below), so I can copy results directly into a spreadsheet from the dataframe output. How can I accomplish this output?
vid conf_not_nec might_need_conf conf_call
0 3014790 16 2
1 12246762 1
2 7989296 3
3 2385739 6
4 14560093 2
5 1901209 1971 48