Last active
September 22, 2020 01:54
-
-
Save kerenskybr/10e55711dc4a31a033e3102c38a5af3b to your computer and use it in GitHub Desktop.
Merge together items from list of lists sequentially
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def merge_list(a_list): | |
"""Merge together items from list of lists sequentially | |
""" | |
return [list(i) for i in list(zip(*a_list))] | |
""" | |
i. e. | |
[[1,2,3], [4,5,6]] | |
result: | |
[[1,4], [2,5], [3,6]] | |
""" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment