Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

dataframe from lists

#import module
import pandas as pd

#have your data as a list of lists - they will each be a ROW
data = [['Stanley', 10, 'blue'],
		['Kyle', 9, 'green'],
        ['Kenny', 10, 'orange'],
        ['Cartman', 10, 'turquoise']]

#convert to Dataframe specifying columns names
df = pd.DataFrame(data, columns=['Name','Age','Hat Color'])
 
PREVIOUS NEXT
Tagged: #dataframe #lists
ADD COMMENT
Topic
Name
5+7 =