本文整理汇总了Python中pandas.core.nanops.nanmax方法的典型用法代码示例。如果您正苦于以下问题:Python nanops.nanmax方法的具体用法?Python nanops.nanmax怎么用?Python nanops.nanmax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandas.core.nanops
的用法示例。
在下文中一共展示了nanops.nanmax方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_nanmax
# 需要导入模块: from pandas.core import nanops [as 别名]
# 或者: from pandas.core.nanops import nanmax [as 别名]
def test_nanmax(self):
with warnings.catch_warnings():
warnings.simplefilter("ignore", RuntimeWarning)
func = partial(self._minmax_wrap, func=np.max)
self.check_funs(nanops.nanmax, func,
allow_str=False, allow_obj=False)
示例2: max
# 需要导入模块: from pandas.core import nanops [as 别名]
# 或者: from pandas.core.nanops import nanmax [as 别名]
def max(self, axis=None, skipna=True, *args, **kwargs):
"""
Return the maximum value of the Array or maximum along
an axis.
See Also
--------
numpy.ndarray.max
Index.max : Return the maximum value in an Index.
Series.max : Return the maximum value in a Series.
"""
# TODO: skipna is broken with max.
# See https://github.com/pandas-dev/pandas/issues/24265
nv.validate_max(args, kwargs)
nv.validate_minmax_axis(axis)
mask = self.isna()
if skipna:
values = self[~mask].asi8
elif mask.any():
return NaT
else:
values = self.asi8
if not len(values):
# short-circut for empty max / min
return NaT
result = nanops.nanmax(values, skipna=skipna)
# Don't have to worry about NA `result`, since no NA went in.
return self._box_func(result)
# -------------------------------------------------------------------
# Shared Constructor Helpers
示例3: max
# 需要导入模块: from pandas.core import nanops [as 别名]
# 或者: from pandas.core.nanops import nanmax [as 别名]
def max(self, axis=None, out=None, keepdims=False, skipna=True):
nv.validate_max((), dict(out=out, keepdims=keepdims))
return nanops.nanmax(self._ndarray, axis=axis, skipna=skipna)
示例4: max
# 需要导入模块: from pandas.core import nanops [as 别名]
# 或者: from pandas.core.nanops import nanmax [as 别名]
def max(self, axis=None, skipna=True):
"""
Return the maximum value of the Index.
Parameters
----------
axis : int, optional
For compatibility with NumPy. Only 0 or None are allowed.
skipna : bool, default True
Returns
-------
scalar
Maximum value.
See Also
--------
Index.min : Return the minimum value in an Index.
Series.max : Return the maximum value in a Series.
DataFrame.max : Return the maximum values in a DataFrame.
Examples
--------
>>> idx = pd.Index([3, 2, 1])
>>> idx.max()
3
>>> idx = pd.Index(['c', 'b', 'a'])
>>> idx.max()
'c'
For a MultiIndex, the maximum is determined lexicographically.
>>> idx = pd.MultiIndex.from_product([('a', 'b'), (2, 1)])
>>> idx.max()
('b', 2)
"""
nv.validate_minmax_axis(axis)
return nanops.nanmax(self._values, skipna=skipna)
示例5: test_nanmax
# 需要导入模块: from pandas.core import nanops [as 别名]
# 或者: from pandas.core.nanops import nanmax [as 别名]
def test_nanmax(self):
with warnings.catch_warnings(record=True):
func = partial(self._minmax_wrap, func=np.max)
self.check_funs(nanops.nanmax, func,
allow_str=False, allow_obj=False)
示例6: max
# 需要导入模块: from pandas.core import nanops [as 别名]
# 或者: from pandas.core.nanops import nanmax [as 别名]
def max(self):
"""
Return the maximum value of the Index.
Returns
-------
scalar
Maximum value.
See Also
--------
Index.min : Return the minimum value in an Index.
Series.max : Return the maximum value in a Series.
DataFrame.max : Return the maximum values in a DataFrame.
Examples
--------
>>> idx = pd.Index([3, 2, 1])
>>> idx.max()
3
>>> idx = pd.Index(['c', 'b', 'a'])
>>> idx.max()
'c'
For a MultiIndex, the maximum is determined lexicographically.
>>> idx = pd.MultiIndex.from_product([('a', 'b'), (2, 1)])
>>> idx.max()
('b', 2)
"""
return nanops.nanmax(self.values)
示例7: max
# 需要导入模块: from pandas.core import nanops [as 别名]
# 或者: from pandas.core.nanops import nanmax [as 别名]
def max(self):
""" The maximum value of the object """
return nanops.nanmax(self.values)
示例8: test_nanmax
# 需要导入模块: from pandas.core import nanops [as 别名]
# 或者: from pandas.core.nanops import nanmax [as 别名]
def test_nanmax(self):
func = partial(self._minmax_wrap, func=np.max)
self.check_funs(nanops.nanmax, func, allow_str=False, allow_obj=False)