Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

Converting Dataframe from the multi-dimensional list

# import pandas as pd 

import pandas as pd 
# List1 
list = [['Softhunt.net', 11], ['Learn', 22], ['coding', 33], ['skills', 44]] 
df = pd.DataFrame(list, columns =['key', 'values']) 
print(df)
Comment

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)
Comment

PREVIOUS NEXT
Code Example
Python :: python sns lable axes 
Python :: python read file into variable 
Python :: uninstall python using powershell 
Python :: selenium save webpage as pdf python 
Python :: python dictionary dynamic key 
Python :: extends template django 
Python :: scipy cosine similarity 
Python :: check if year is leap python 
Python :: turn list in to word python 
Python :: how can i plot graph from 2 dataframes in same window python 
Python :: Python Requests Library Patch Method 
Python :: end python print with space 
Python :: install aws sdk python 
Python :: how to extract words from string in python 
Python :: audioplayer python 
Python :: django view - APIView (retrieve, update or delete - GET, PUT, DELETE) 
Python :: how to open cmd at specific size using python 
Python :: set xlim histogram python 
Python :: new dataframe based on certain row conditions 
Python :: print first word of a string python and return it 
Python :: seaborn iris dataset 
Python :: dataframe to dictionary using index as key 
Python :: windows error message python 
Python :: Iterate through characters of a string in python 
Python :: python install minio 
Python :: match python 
Python :: python read values from file 
Python :: get last n in array python 
Python :: get keys from dictionary python 
Python :: how to get key value in nested dictionary python 
ADD CONTENT
Topic
Content
Source link
Name
1+2 =