Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. # zip ``` sequences = [["a", 1], ["b", 2], ["c", 3]] # 리스트의 리스트 또는 행렬 또는 뒤에서 배울 개념인 2D 텐서. X, y = zip(*sequences) # *를 추가 print(X) print(y) ``` ``` ('a', 'b', 'c') (1, 2, 3) ``` ### *를 제거 ``` sequences = [["a", 1], ["b", 2], ["c", 3]] X, y = zip(sequences) ``` ``` ValueError Traceback (most recent call last) <ipython-input-128-5ccd3fc6cd1f> in <module> 1 sequences = [["a", 1], ["b", 2], ["c", 3]] ----> 2 X, y = zip(sequences) ValueError: too many values to unpack (expected 2) ``` open/zip.txt Last modified: 2024/10/05 06:15by 127.0.0.1