Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

list to dataframe columns

import pandas as pd

lst = [1,2,3]
df = pd.DataFrame([lst])
df.columns =['col1','col2','col3']
df

to get this:

    col1    col2    col3
0   1       2       3
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #list #dataframe #columns
ADD COMMENT
Topic
Name
3+6 =