Answers for "pandas change list to dataframe"

1

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
1

convert list to dataframe

L = ['Thanks You', 'Its fine no problem', 'Are you sure']

#create new df 
df = pd.DataFrame({'col':L})
print (df)

                   col
0           Thanks You
1  Its fine no problem
2         Are you sure
Posted by: Guest on July-23-2020
0

list to dataframe

# import pandas as pd
import pandas as pd 
    
# List1 
lst = [['tom', 25], ['krish', 30],
       ['nick', 26], ['juli', 22]]
    
df = pd.DataFrame(lst, columns =['Name', 'Age'])
df
Posted by: Guest on September-23-2021

Code answers related to "pandas change list to dataframe"

Python Answers by Framework

Browse Popular Code Answers by Language