Create DF from 2 lists
user_6939821
python
2 years ago
291 B
7
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...