Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

python split tuples into lists

>>> source_list = [('1','a'),('2','b'),('3','c'),('4','d')]
>>> list1, list2 = zip(*source_list)
>>> list1
('1', '2', '3', '4')
>>> list2
('a', 'b', 'c', 'd')
Comment

PREVIOUS NEXT
Code Example
Python :: hello world flask python 
Python :: create spark dataframe in python 
Python :: delete index in df 
Python :: matplotlib create histogram edge color 
Python :: finding if user input is lower or upper in python 
Python :: python find closest value in list to zero 
Python :: filter list dict 
Python :: md5 hash python 
Python :: data science standard deviation 
Python :: corona 
Python :: python wait until 
Python :: python sftp put file 
Python :: pytorch save model 
Python :: supprimer ligne python dataframe 
Python :: flask post vs get 
Python :: pandas groupby get all but first row 
Python :: chi square test in python 
Python :: get the last element of a list python 
Python :: python- number of row in a dataframe 
Python :: python datetime into 12-hour format 
Python :: get_terminal_sizee python 
Python :: pandas new df from groupby 
Python :: how to join a list of characters in python 
Python :: extract link from text python 
Python :: python get dates between two dates 
Python :: dataframe to dictionary with one column as key 
Python :: how to roll longitude axis 
Python :: delete index in elasticsearch python 
Python :: python boxplot show mean 
Python :: pandas add rows from df to another 
ADD CONTENT
Topic
Content
Source link
Name
8+6 =