pd.Series.nlargest
mySeries.nlargest(1)
a 3
dtype: int64
Answer from piRSquared on Stack OverflowPandas
pandas.pydata.org › docs › reference › api › pandas.Series.max.html
pandas.Series.max — pandas 3.0.2 documentation - PyData |
Return the index of the maximum over the requested axis. ... >>> idx = pd.MultiIndex.from_arrays( ... [["warm", "warm", "cold", "cold"], ["dog", "falcon", "fish", "spider"]], ... names=["blooded", "animal"], ... ) >>> s = pd.Series([4, 2, 0, 8], name="legs", index=idx) >>> s blooded animal warm dog 4 falcon 2 cold fish 0 spider 8 Name: legs, dtype: int64
Top answer 1 of 3
13
pd.Series.nlargest
mySeries.nlargest(1)
a 3
dtype: int64
2 of 3
1
One with boolean indexing (just an alternative) i.e
mySeries[mySeries.index==mySeries.idxmax()]
or
mySeries[mySeries == mySeries.max()]
or(Thanks @piRSquared)
mySeries[[mySeries.idxmax()]]
Output:
a 3 dtype: int64
Videos
01:25
How to Get Maximum value for Columns in Pandas DataFrame Approach1 ...
04:44
Find the Min and Max Values for Rows and Columns - Pandas - YouTube
10:46
Pandas Dataframe Min & Max Values, Min & Max Index with Python ...
03:30
How to find the mean or max or min of all the Python pandas columns ...
02:18
46- Pandas DataFrames: Finding Min/Max Element - YouTube
Pandas
pandas.pydata.org › docs › reference › api › pandas.Series.idxmax.html
pandas.Series.idxmax — pandas 3.0.1 documentation - PyData |
Return index of first occurrence of maximum over requested axis. ... Return index label of the first occurrence of minimum of values. ... This method is the Series version of ndarray.argmax. This method returns the label of the maximum, while ndarray.argmax returns the position.
Pandas
pandas.pydata.org › pandas-docs › stable › reference › api › pandas.Series.max.html
pandas.Series.max — pandas 3.0.2 documentation
Return the index of the maximum over the requested axis. ... >>> idx = pd.MultiIndex.from_arrays( ... [["warm", "warm", "cold", "cold"], ["dog", "falcon", "fish", "spider"]], ... names=["blooded", "animal"], ... ) >>> s = pd.Series([4, 2, 0, 8], name="legs", index=idx) >>> s blooded animal warm dog 4 falcon 2 cold fish 0 spider 8 Name: legs, dtype: int64
Pandas
pandas.pydata.org › pandas-docs › version › 0.24.2 › reference › api › pandas.Series.max.html
pandas.Series.max — pandas 0.24.2 documentation
>>> idx = pd.MultiIndex.from_arrays([ ... ['warm', 'warm', 'cold', 'cold'], ... ['dog', 'falcon', 'fish', 'spider']], ... names=['blooded', 'animal']) >>> s = pd.Series([4, 2, 0, 8], name='legs', index=idx) >>> s blooded animal warm dog 4 falcon 2 cold fish 0 spider 8 Name: legs, dtype: int64 · >>> s.max() 8 · Max using level names, as well as indices. >>> s.max(level='blooded') blooded warm 4 cold 8 Name: legs, dtype: int64 · >>> s.max(level=0) blooded warm 4 cold 8 Name: legs, dtype: int64 · index · modules | next | previous | pandas 0.24.2 documentation » ·
Pandas
pandas.pydata.org › pandas-docs › version › 1.5 › reference › api › pandas.Series.max.html
pandas.Series.max — pandas 1.5.2 documentation
Series.max(axis=_NoDefault.no_default, skipna=True, level=None, numeric_only=None, **kwargs)[source]#
Apache
spark.apache.org › docs › latest › api › python › reference › pyspark.pandas › api › pyspark.pandas.Series.max.html
pyspark.pandas.Series.max — PySpark 4.1.1 documentation
Return the maximum of the values. ... Axis for the function to be applied on. ... Exclude NA/null values when computing the result. Changed in version 3.4.0: Supported including NA/null values. ... If True, include only float, int, boolean columns. This parameter is mainly for pandas compatibility.
w3resource
w3resource.com › pandas › series › series-max.php
Pandas Series: max() function - w3resource
September 15, 2022 - Pandas Series - max() function: The max() function is used to return the maximum of the values for the requested axis.
Pandas
pandas.pydata.org › pandas-docs › version › 0.17.0 › generated › pandas.Series.max.html
pandas.Series.max — pandas 0.17.0 documentation
Series.max(axis=None, skipna=None, level=None, numeric_only=None, **kwargs)¶ · This method returns the maximum of the values in the object. If you want the index of the maximum, use idxmax. This is the equivalent of the numpy.ndarray method argmax. index · modules | next | previous | pandas ...
Pandas
pandas.pydata.org › docs › dev › reference › api › pandas.Series.max.html
pandas.Series.max — pandas 3.0.0rc2+1.g0d0ec6f2c0 documentation
The maximum of the values in the Series.
pandas
pandas.pydata.org › pandas-docs › dev › reference › api › pandas.Series.max.html
pandas.Series.max — pandas 3.0.0rc2+20.g501c5052ca documentation
Return the index of the maximum over the requested axis. ... >>> idx = pd.MultiIndex.from_arrays( ... [["warm", "warm", "cold", "cold"], ["dog", "falcon", "fish", "spider"]], ... names=["blooded", "animal"], ... ) >>> s = pd.Series([4, 2, 0, 8], name="legs", index=idx) >>> s blooded animal warm dog 4 falcon 2 cold fish 0 spider 8 Name: legs, dtype: int64
Pandas
pandas.pydata.org › pandas-docs › stable › generated › pandas.Series.max.html
Pydata
The page has been moved to this page
Pandas
pandas.pydata.org › pandas-docs › stable › reference › api › pandas.Series.idxmax.html
pandas.Series.idxmax — pandas 2.3.3 documentation
Return index of first occurrence of maximum over requested axis. ... Return index label of the first occurrence of minimum of values. ... This method is the Series version of ndarray.argmax. This method returns the label of the maximum, while ndarray.argmax returns the position.
Intelpython
intelpython.github.io › sdc-doc › latest › _api_ref › pandas.Series.max.html
pandas.Series.max — Intel® Scalable Dataframe Compiler 0.1 documentation
Getting the maximum value of Series elements¶ · import pandas as pd from numba import njit @njit def series_max(): s = pd.Series([1, 4, 2, 0]) out_series = s.max() return out_series # Expect maximum value 4 print(series_max()) $ python ./series/series_max.py 4 ·
Pandas
pandas.pydata.org › pandas-docs › version › 0.19 › generated › pandas.Series.max.html
pandas.Series.max — pandas 0.19.2 documentation
Series.max(axis=None, skipna=None, level=None, numeric_only=None, **kwargs)[source]¶ · This method returns the maximum of the values in the object. If you want the index of the maximum, use idxmax. This is the equivalent of the numpy.ndarray method argmax. index · modules | next | previous ...
W3Schools
w3schools.com › python › pandas › ref_df_max.asp
Pandas DataFrame max() Method
import pandas as pd data = [[10, 18, 11], [13, 15, 8], [9, 20, 3]] df = pd.DataFrame(data) print(df.max()) Try it Yourself » · The max() method returns a Series with the maximum value of each column.
Pandas
pandas.pydata.org › pandas-docs › version › 2.1 › reference › api › pandas.Series.max.html
pandas.Series.max — pandas 2.1.4 documentation - PyData |
Return the index of the maximum over the requested axis. ... >>> idx = pd.MultiIndex.from_arrays([ ... ['warm', 'warm', 'cold', 'cold'], ... ['dog', 'falcon', 'fish', 'spider']], ... names=['blooded', 'animal']) >>> s = pd.Series([4, 2, 0, 8], name='legs', index=idx) >>> s blooded animal warm dog 4 falcon 2 cold fish 0 spider 8 Name: legs, dtype: int64
Pandas
pandas.pydata.org › pandas-docs › version › 0.25 › reference › api › pandas.Series.max.html
pandas.Series.max — pandas 0.25.3 documentation
>>> idx = pd.MultiIndex.from_arrays([ ... ['warm', 'warm', 'cold', 'cold'], ... ['dog', 'falcon', 'fish', 'spider']], ... names=['blooded', 'animal']) >>> s = pd.Series([4, 2, 0, 8], name='legs', index=idx) >>> s blooded animal warm dog 4 falcon 2 cold fish 0 spider 8 Name: legs, dtype: int64 · >>> s.max() 8 · Max using level names, as well as indices. >>> s.max(level='blooded') blooded warm 4 cold 8 Name: legs, dtype: int64 · >>> s.max(level=0) blooded warm 4 cold 8 Name: legs, dtype: int64 · index · modules | next | previous | pandas 0.25.3 documentation » ·