Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

convert list of lists to pandas dataframe

salary = [['Company', 'Job', 'Salary($)'],
          ['Google', 'Machine Learning Engineer', 121000],
          ['Google', 'Data Scientist', 109000],
          ['Google', 'Tech Lead', 129000],
          ['Facebook', 'Data Scientist', 103000]]
df = pd.DataFrame(salary[1:], columns=salary[0])
Source by blog.finxter.com #
 
PREVIOUS NEXT
Tagged: #convert #list #lists #pandas #dataframe
ADD COMMENT
Topic
Name
7+3 =