simple way to merge list data2.category >>> 437624 [16] 437625 [23] 437627 [23] 437628 [9, 0, 23, 10] 437629 [19, 20, 23] ... tolist = data2.category.tolist() tolist = sum(tolist, []) >>> [16, 23, 23, 0, 9, ...] Basic Python/Workbook 2022.11.22