I have a dataset with two columns: sID (string identifier) and sum_count (numeric value). My goal is to partition these sIDs into 5 groups with the following requirements: The sum of sum_count values in each group should be as equal as possible (exact equality is not required, but close approximations are preferred). Within each group, the sIDs should be merged into a comma-separated string. Example Input: sID sum_count A 10 B 5 C 8 D 12 E 9 F 13 Expected Output Format: Group1: sID=A,C,E | sum_count_total=27 Group2: sID=B,D,F | sum_count_total=30 ... # Continuing for 5 groups I tried naive methods like: Random sampling Sorting by sum_count followed by round-robin/cyclic distribution But these produced imbalanced group sums (e.g., ±20% variance). Is there a more efficient algorithm or existing tool (e.g., Python library, DolphinDB function) to achieve this? Continue reading...