Search
 
SCRIPT & CODE EXAMPLE
 

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)
Comment

PREVIOUS NEXT
Code Example
Python :: turtle example in python 
Python :: selection sort python 
Python :: python get latest edited file from any directory 
Python :: delete directory if exists python 
Python :: how to check if a cell is empty in openpyxl 
Python :: remove specific word from string using python 
Python :: how to iterate over rows in a dataframe in pandas 
Python :: python get item from queue 
Python :: import error in same directory python 
Python :: mouse bottom in pygame 
Python :: instabot login python 
Python :: get rid of unnamed column pandas 
Python :: numpy sort array by another array 
Python :: django secure variable 
Python :: hello world in python 
Python :: close python window after execution 
Python :: pandas read_csv column names 
Python :: how to sort values of pandas dataframe for iqr 
Python :: exec: "python": executable file not found in $PATH Error compiling for board ESP32 Dev Module. 
Python :: import gensim 
Python :: python print numbers 1 to 10 in one line 
Python :: how to save the model in python 
Python :: sort a stack using recursion 
Python :: commentaire python 
Python :: python check for duplicate 
Python :: how to start a new django project 
Python :: chrome driver in python selenium not working 
Python :: json url to dataframe python 
Python :: color name to hex python 
Python :: train split 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =