我有一个清单如下:
['MARK_A', 8, 7702.5, 13, 7703, 983472],
['MARK_B', 10, 7702.5, 983472],
['MARK_B', 3, 7703.5, 983472],
['MARK_B', 6, 7701.2, 983472],
['MARK_B', 5, 7704.4, 983472],
['MARK_A', 9, 7701.5, 11, 7704, 983475],
['MARK_B', 10, 7702.5, 983475],
['MARK_B', 3, 7703.5, 983475],
['MARK_B', 6, 7701.2, 983475],
['MARK_B', 5, 7704.4, 983475]]
如何将此列表拆分为 2 个列表,如下所示:
[['MARK_A', 8, 7702.5, 13, 7703, 983472],
['MARK_B', 10, 7702.5, 983472],
['MARK_B', 3, 7703.5, 983472],
['MARK_B', 6, 7701.2, 983472],
['MARK_B', 5, 7704.4, 983472]],
[ ['MARK_A', 9, 7701.5, 11, 7704, 983475],
['MARK_B', 10, 7702.5, 983475],
['MARK_B', 3, 7703.5, 983475],
['MARK_B', 6, 7701.2, 983475],
['MARK_B', 5, 7704.4, 983475]]
列表中可以有任意数量的“MARK_A”,后跟一个或多个“MARK_B”。我将列表除以 [-1] 元素