Create DF from 2 lists

user_6939821 avatar
user_6939821
python
08/03/2023 8:39 AM
388 B
17
Indexable
## Create DF from 2 lists (using zip() )  


import pandas as pd
  
# list of strings
lst = ['Geeks', 'For', 'Geeks', 'is', 'portal', 'for', 'Geeks']
  
# list of int
lst2 = [11, 22, 33, 44, 55, 66, 77]
  
df = pd.DataFrame(list(zip(lst, lst2)),
               columns =['Name', 'val'])
df

Editor is loading...