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 :: NameError: name ‘pd’ is not defined 
Python :: python regex remove digits from string 
Python :: python for loop backwards 
Python :: python csv add row 
Python :: what is a module computer science 
Python :: print items in object python 
Python :: subtract one list from another python 
Python :: add a title to pandas dataframe 
Python :: months of the year python list 
Python :: pandas read_csv multiple separator 
Python :: python subtract one list from another 
Python :: read data from yaml file in python 
Python :: import counter python 
Python :: download image python 
Python :: how to find columns of a dataframe 
Python :: python draw polygon 
Python :: fiel to base64 python 
Python :: how to read a .exe file in python 
Python :: space to underscore python 
Python :: save timestamp python 
Python :: how to make a complex calculator in python 
Python :: all characters python 
Python :: how to make a button circular in python 
Python :: multivariate outlier detection python 
Python :: all alphabets 
Python :: Python - Drop row if two columns are NaN 
Python :: how to roll longitude coordinate 
Python :: dataframe delete row 
Python :: how to show webcam in opencv 
Python :: tkinter refresh window 
ADD CONTENT
Topic
Content
Source link
Name
6+5 =