Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这个数组:
[160, 177], [162, 169], [163, 169], [166, 173], [166, 176], [166, 177], [169, 176], [169, 177]]
如何将其拆分为 2 个单独的数组,使其变为:
[160,162,163,166,166,166,169,169]
和
[177,169,169,173,176,177,176,177]
这应该这样做
l = [[160, 177], [162, 169], [163, 169], [166, 173], [166, 176], [166, 177], [169, 176], [169, 177]] l1, l2 = zip(*l)