I just want to reshape the List without use the numpy, so I found a piece of crazy code in stackoverflow:

l = ['a', 'b', 'c', 'd', 'e', 'f']
zip(*[iter(l)]*2)

output: [(‘a’, ‘b’), (‘c’, ‘d’), (‘e’, ‘f’)]

After the long consideration, I understand the code at last. The python programmer are really …

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.