Skip to content

Instantly share code, notes, and snippets.

@kerenskybr
Last active September 22, 2020 01:54
Show Gist options
  • Save kerenskybr/10e55711dc4a31a033e3102c38a5af3b to your computer and use it in GitHub Desktop.
Save kerenskybr/10e55711dc4a31a033e3102c38a5af3b to your computer and use it in GitHub Desktop.
Merge together items from list of lists sequentially
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