79290351

Date: 2024-12-18 08:03:43
Score: 0.5
Natty:
Report link

If you don't need the hierarchical dict structure, you could try:

grouped = df.groupby(['Region', 'Country', 'AREA_CODE'])
pd.concat([grouped.AREA_SUB_CODE_1.apply(list), grouped.AREA_SUB_CODE_2.apply(list)], axis=1)
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: techtech