Create a Pandas Dataframe from Two or More Lists

You might encounter this if you simply have a python file of lists or you may have a list from webscraping.

Step 1: Zip the Lists

data = list(zip(list1,list2,list3))

Step 2: Convert to Pandas Dataframe

df = pd.DataFrame(data, columns=['Column_name1','Column_name2','Column_name3'])


Posted

in

by