Creating a series from dictionary in pandas
First we want to create the dictionary.Next we want to convert the dictionary into pandas series by using pd.series in the pandas concepts for that we want to import the pandas.
Example-1
import pandas as pd d = { "X" : 1, "Y" : 2, "Z" : 3} n = pd.Series(d) print(n)
Output
X 1 Y 2 Z 3 dtype: int64
Example-2
import pandas as pd d = { "Name" : "Mycrazycoding" , "Year" : 2020} n = pd.Series(d) print(n)
Output
Name Mycrazycoding Year 2020 dtype: object