Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Converting List to Dataframe Using zip() function

import pandas as pd 
# list of strings 
list1 = ['Softhunt.net', 'Learn', 'coding', 'skills']
# list of int 
list2 = [11, 22, 33, 44] 
# Calling DataFrame after zipping both lists, with columns specified 
df = pd.DataFrame(list(zip(list1, list2)), columns =['key', 'value']) 
print(df)
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Converting #List #Dataframe #Using #function
ADD COMMENT
Topic
Name
3+7 =