Ratakan daftar menggunakan numpy dan itertools

import itertools
L1 = [[1, 2, 3, 4,20,30,40], [5, 6, 7,99,97,98], [81, 9, 100]]
flat_list = list(itertools.chain(*L1))
print(sorted(flat_list))
[1, 2, 3, 4, 5, 6, 7, 9, 20, 30, 40, 81, 97, 98, 99, 100]

import numpy
L1 = [[1, 2, 3, 4,20,30,40], [5, 6, 7,99,97,98], [81, 9, 100]]
flat_list = list(numpy.concatenate(L1).flat)
print(sorted(flat_list))
[1, 2, 3, 4, 5, 6, 7, 9, 20, 30, 40, 81, 97, 98, 99, 100]
Impossible Impala