Answers for "how to put a list into a dataframe python"

4

how to convert a list into a dataframe in python

from pandas import DataFrame

People_List = ['Jon','Mark','Maria','Jill','Jack']

df = DataFrame (People_List,columns=['First_Name'])
print (df)
Posted by: Guest on October-07-2020
0

how to add a list to dataframe in python

to_append = [5, 6]
a_series = pd.Series(to_append, index = df.columns)
df = df.append(a_series, ignore_index=True)
Posted by: Guest on September-01-2021

Code answers related to "how to put a list into a dataframe python"

Python Answers by Framework

Browse Popular Code Answers by Language