This does not work because the length [(dat[0], dat[2]) for dat in all_data]matches the length all_data, which is not the same length as the tuple (ids, gds).
Try this instead:
(ids, gds) = zip(*[(dat[0], dat[2]) for dat in all_data])
or even shorter:
(ids, gds) = zip(*all_data)[::2]
, ids gds , , , :
(ids, gds) = map(list, zip(*all_data)[::2])
zip(*something) - python. ,
l = [[1, 2, 3],
[4, 5, 6]]
zip(*l) :
zip(*l) == [(1, 4),
(2, 5),
(3, 6)]
* : some_func(*some_list) some_list, some_list . , zip(*l) zip([1, 2, 3], [4, 5, 6]). python.
zip zipper, , , : , ..