Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

Converting Dataframe from the multi-dimensional list with column name

# 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: #Converting #Dataframe #list #column
ADD COMMENT
Topic
Name
2+4 =