Convert a list to dataframe with headers

Question:

I have a question
I have a list

list=['nick', 'george', 'kate']

Is it possible to convert it into a dataframe with headers the names of the list ? (‘nick’ etc.)
probably it’s easy but I am a beginner so I struggle a little bit thanks!

Answers:

Code

import pandas as pd

list = ['nick', 'george', 'kate']

df = pd.DataFrame(list, columns =['name'])

print(df)

Output

     name
0    nick
1  george
2    kate 
Answered By: Vinícius Félix
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.