Pandas 系列是带有轴标签的一维ndarray。标签不必是唯一的,但必须是可哈希的类型。该对象同时支持基于整数和基于标签的索引,并提供了许多方法来执行涉及索引的操作。
Pandas Series.max()函数返回给定Series对象中基础数据的最大值。即使仅返回一个值,此函数也始终返回Series。
用法: Series.max(axis=None, skipna=None, level=None, numeric_only=None, **kwargs)
参数:
axis:要应用的功能的轴。
skipna:计算结果时排除NA /null值。
level:如果轴是MultiIndex(分层),则沿特定级别计数,并折叠成标量。
numeric_only:仅包括float,int,boolean列。
**kwargs:要传递给函数的其他关键字参数。
返回:max:标量或系列(如果指定级别)
范例1:采用Series.max()函数可在给定系列对象的基础数据中找到最大值。
# importing pandas as pd
import pandas as pd
# Creating the Series
sr = pd.Series([10, 25, 3, 25, 24, 6])
# Create the Index
index_ = ['Coca Cola', 'Sprite', 'Coke', 'Fanta', 'Dew', 'ThumbsUp']
# set the index