So the data has the column [outbreakMap] as a pandas series. I recreated a snippet of the data as a df below:
data = {0: {'id': '53545',
'latitude': -1.5168500000000003,
'longitude': 105.2985,
'outbreakMap': {'ob_102795': {'nationalObReference': '403/KPTS/05/22',
'oieReference': 'ob_102795',
'outbreakStartDate': '2022-04-12'},
'ob_102796': {'nationalObReference': '404/KPTS/05/22',
'oieReference': 'ob_102796',
'outbreakStartDate': '2022-04-22'}}},
1: {'id': '53709',
'latitude': 36.42056,
'longitude': 139.9085,
'outbreakMap': {'ob_101531': {'oieReference': 'ob_101531',
'outbreakStartDate': '2022-04-12'},
'ob_101644': {'oieReference': 'ob_101644',
'outbreakStartDate': '2022-04-14'},
'ob_102290': {'oieReference': 'ob_102290',
'outbreakStartDate': '2022-04-21'},
'ob_100121': {'oieReference': 'ob_100121',
'outbreakStartDate': '2022-03-24'},
'ob_102949': {'oieReference': 'ob_102949',
'outbreakStartDate': '2022-05-09'}}}}
import pandas as pd
df = pd.DataFrame.from_dict(data, orient='index')
Goal: Unpack the dictionary into a long format like-so:
Thank you.