Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

make dataframe from list of tuples

# import pandas to use pandas DataFrame
import pandas as pd
  
# data in the form of list of tuples
data = [('Peter', 18, 7),
        ('Riff', 15, 6),
        ('John', 17, 8),
        ('Michel', 18, 7),
        ('Sheli', 17, 5) ]
  
  
# create DataFrame using data
df = pd.DataFrame(data, columns =['Name', 'Age', 'Score'])
  
print(df)
Comment

PREVIOUS NEXT
Code Example
Python :: python list of dates between 
Python :: how to convert a list into a dataframe in python 
Python :: how to open local html file in python 
Python :: bgr to gray opencv 
Python :: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. 
Python :: edit json file python 
Python :: convert string to unicode python 3 
Python :: python merge pdfs 
Python :: how to send get request python 
Python :: python install module from script 
Python :: python system arguments 
Python :: converting string array to int array python 
Python :: display max rows pandas 
Python :: ddos in python 
Python :: how to convert a am pm string to 24 hrs time python 
Python :: Installing yfinance using pip 
Python :: extract frames from video python 
Python :: python number to array of digits 
Python :: counter in sort python 
Python :: django raise 404 
Python :: python format currency 
Python :: module pygame has no member 
Python :: calculate euclidian distance python 
Python :: python nltk tokenize 
Python :: tkinter start maximized 
Python :: pandas index to list 
Python :: create new thread python 
Python :: how to trim mp4 with moviepy 
Python :: how to do label encoding in multiple column at once 
Python :: how to play a mp3 file in python 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =