Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas dataframe from dict

# import pandas library
import pandas as pd
  
# dictionary
details = {
    'Ankit' : 22,
    'Golu' : 21,
    'hacker' : 23
    }
  
# creating a Dataframe object from a list 
# of tuples of key, value pair
df = pd.DataFrame(list(details.items()))
  
df
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #pandas #dataframe #dict
ADD COMMENT
Topic
Name
6+6 =