Program to convert a dictionary to a Pandas series.

In this python pandas program, we will convert a dictionary to a Pandas series.

Steps to solve the program
  1. Import pandas library as pd.
  2. Create a dictionary.
  3. Now convert that dictionary to a series using pd.Series().
  4. Print the output.
				
					import pandas as pd
D = {'name':'Virat','sport':'cricket','age':32}
result = pd.Series(D)
print(result)
				
			

Output :

				
					name       Virat
sport    cricket
age           32
dtype: object
				
			

check whether elements in the series are greater than other series

convert a NumPy array to a Pandas series

Leave a Comment