Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Using a list with index and column names to Convert List to Dataframe

# import pandas as pd 

import pandas as pd 
# List1 
list = [['apple', 'red', 44], ['grape', 'green', 33], ['orange', 'orange', 22], ['mango', 'yellow', 11]] 
df = pd.DataFrame(list, columns =['Fruits', 'Color', 'Value'], dtype = float) 
print(df)
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Using #list #index #column #names #Convert #List #Dataframe
ADD COMMENT
Topic
Name
4+3 =