I have a nested list like this:
my_list = [[1320120000000, 48596281], [1320206400000, 48596281], [1320292800000, 50447908]]
I would like to split it into something that looks like this:
my_list1 = [48596281, 48596281, 50447908]
my_list2 = [1320120000000, 1320206400000, 1320292800000]
I know that this is fairly simple, but I haven't been able to get it to work. Any help would be much appreciated.
You can use list comprehension.
This is what the builtin function
zip
is for.If you want lists instead of tuples, you can do
using
list comprehension
:or using
operator.itemgetter()
:timeit
comparisons: