Python - Convert dict of list to Pandas dataframe Last Updated : 28 Nov, 2021 Comments Improve Suggest changes Like Article Like Report In this article, we will discuss how to convert a dictionary of lists to a pandas dataframe. Method 1: Using DataFrame.from_dict() We will use the from_dict method. This method will construct DataFrame from dict of array-like or dicts. Syntax: pandas.DataFrame.from_dict(dictionary) where dictionary is the input dictionary Example: Program to take student dictionary as input and display subjects data then store in pandas dataframe Python3 # import pandas module import pandas as pd # create a dictionary for three subjects with list # of three subjects for each student data = { 'manoj': ["java", "php", "python"], 'tripura': ["bigdata", "c/cpp", "R"], 'uma': ["js/css/html", "ruby", "IOT"] } # convert to dataframe using from_dict method pd.DataFrame.from_dict(data) Output: Suppose if we want to get the dataframe with keys as row names then we have to use the orient parameter Syntax: pd.DataFrame.from_dict(data,orient='index') Example: Python3 # import pandas module import pandas as pd # create a dictionary for three subjects with list # of three subjects for each student data = { 'manoj': ["java", "php", "python"], 'tripura': ["bigdata", "c/cpp", "R"], 'uma': ["js/css/html", "ruby", "IOT"] } # convert to dataframe using from_dict method # with orient pd.DataFrame.from_dict(data, orient='index') Output: Method 2: Using pd.Series()Â Here we are using Series data structure inside the dataframe method by using the items() method Syntax: pd.DataFrame({ key: pd.Series(val) for key, val in dictionary.items() }) where dictionary.items() is the method to get items from the dictionarypd.Series(val) will get series of values from the items() method Example: Python3 # import pandas module import pandas as pd # create a dictionary for three subjects with list # of three subjects for each student data = { 'manoj': ["java", "php", "python"], 'tripura': ["bigdata", "c/cpp", "R"], 'uma': ["js/css/html", "ruby", "IOT"] } # convert to dataframe using series with items() method pd.DataFrame({key: pd.Series(val) for key, val in data.items()}) Output: Comment More infoAdvertise with us Next Article Python - Convert dict of list to Pandas dataframe M manojkumarreddymallidi Follow Improve Article Tags : Python Python-pandas Python pandas-dataFrame Practice Tags : python Similar Reads How to convert pandas DataFrame into JSON in Python? We are given a pandas DataFrame, and our task is to convert it into JSON format using different orientations and custom options. JSON (JavaScript Object Notation) is a lightweight, human-readable format used for data exchange. With Pandas, this can be done easily using the to_json() method. For exam 4 min read How to convert Dictionary to Pandas Dataframe? Converting a dictionary into a Pandas DataFrame is simple and effective. You can easily convert a dictionary with key-value pairs into a tabular format for easy data analysis. Lets see how we can do it using various methods in Pandas.1. Using the Pandas ConstructorWe can convert a dictionary into Da 2 min read Python | Convert list of nested dictionary into Pandas dataframe Given a list of the nested dictionary, write a Python program to create a Pandas dataframe using it. We can convert list of nested dictionary into Pandas DataFrame. Let's understand the stepwise procedure to create a Pandas Dataframe using the list of nested dictionary. Convert Nested List of Dictio 4 min read How to Convert Pandas DataFrame into a List? In this article, we will explore the process of converting a Pandas DataFrame into a List, We'll delve into the methods and techniques involved in this conversion, shedding light on the versatility and capabilities of Pandas for handling data structures in Python.Ways to convert Pandas DataFrame Int 7 min read How To Convert Pandas Dataframe To Nested Dictionary In this article, we will learn how to convert Pandas DataFrame to Nested Dictionary. Convert Pandas Dataframe To Nested DictionaryConverting a Pandas DataFrame to a nested dictionary involves organizing the data in a hierarchical structure based on specific columns. In Python's Pandas library, we ca 2 min read Like