Open In App

Python | Pandas Index.summary()

Last Updated : 18 Dec, 2018
Comments
Improve
Suggest changes
Like Article
Like
Report
Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier. Pandas Index.summary() function return a summarized representation of the Index. This function is similar to what we have for the dataframes.
Syntax: Index.summary(name=None) Returns : Summary
Example #1: Use Index.summary() function to find the summary of the Index. Python3
# importing pandas as pd
import pandas as pd

# Creating the index 
idx = pd.Index(['Beagle', 'Pug', 'Labrador',
                'Sephard', 'Mastiff', 'Husky'])

# Print the index
idx
Output : Now we will find the summary of the Index. Python3 1==
# find the summary of the Index.
idx.summary()
Output : As we can see in the output, the function has returned an overall summary of the Index.   Example #2: Use Index.summary() function to summarize the Index. Python3
# importing pandas as pd
import pandas as pd

# Creating the index 
idx = pd.Index([22, 14, 8, 56, 27, 21, 51, 23])

# Print the index
idx
Output : Now we will find the summary of the index. Python3 1==
# the function returns the summary of the Index
idx.summary()
Output : As we can see in the output, the function has returned the summary for the Index.

Next Article

Similar Reads