Python是进行数据分析的一种出色语言,主要是因为以数据为中心的python软件包具有奇妙的生态系统。 Pandas是其中的一种,使导入和分析数据更加容易。
 Pandas  Index.summary()函数返回Index的摘要表示。此函数类似于 DataFrame 的函数。
用法: Index.summary(name=None)
返回值:摘要
范例1:采用Index.summary()函数查找索引摘要。
# importing pandas as pd 
import pandas as pd 
  
# Creating the index  
idx = pd.Index(['Beagle', 'Pug', 'Labrador', 
                'Sephard', 'Mastiff', 'Husky']) 
  
# Print the index 
idx输出:

现在,我们将找到索引的摘要。
# find the summary of the Index. 
idx.summary()输出:

从输出中可以看到,该函数返回了Index的总体摘要。
范例2:采用Index.summary()汇总索引的函数。
# 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输出:

现在,我们将找到索引的摘要。
# the function returns the summary of the Index 
idx.summary()输出:

正如我们在输出中看到的那样,该函数已返回Index的摘要。
相关用法
- Python pandas.map()用法及代码示例
- Python Pandas Series.str.len()用法及代码示例
- Python Pandas.factorize()用法及代码示例
- Python Pandas TimedeltaIndex.name用法及代码示例
- Python Pandas dataframe.ne()用法及代码示例
- Python Pandas Series.between()用法及代码示例
- Python Pandas DataFrame.where()用法及代码示例
- Python Pandas Series.add()用法及代码示例
- Python Pandas.pivot_table()用法及代码示例
- Python Pandas Series.mod()用法及代码示例
- Python Pandas Dataframe.at[ ]用法及代码示例
- Python Pandas Dataframe.iat[ ]用法及代码示例
- Python Pandas.pivot()用法及代码示例
- Python Pandas dataframe.mul()用法及代码示例
- Python Pandas.melt()用法及代码示例
注:本文由纯净天空筛选整理自Shubham__Ranjan大神的英文原创作品 Python | Pandas Index.summary()。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
