本文整理匯總了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)