Python is a great language for doing data analysis, primarily because of the fantastic ecosystem of data-centric python packages. Pandas is one of those packages and makes importing and analyzing data much easier.
Index.max() function returns the maximum value of the Index. The function works with both numerical as well as the string type objects. In case of string type object it returns the string which has highest value in lexicographical order.
Parameters : Doesn’t take any parameter.
Returns : scalar: Maximum value.
Example #1: Use
Index.max() function to find the maximum element in the given Index.
Now we find the max value in the given Index.
As we can see in the output, the function has returned ‘Mastiff’ which has the highest lexicographical order among the values present in the Index.
Example #2: Use
Index.max() function to find the maximum value in the Index.
Now we will find the maximum value among the labels of the Index.
As we can see in the output, the function has returned 74 which is the largest value among the labels of the Index.
- Python | pandas.map()
- Python | Pandas Series.mean()
- Python | Pandas DataFrame.loc
- Python | Pandas.factorize()
- Python | Pandas Series.str.len()
- Python | Pandas Series.between()
- Python | Pandas DataFrame.where()
- Python | Pandas Period.second
- Python | Pandas Series.dt.second
- Python | Pandas.pivot()
- Python | Pandas Series.last()
- Python | Pandas dataframe.div()
- Python | Pandas.melt()
- Introduction to Pandas in Python
- Python | Pandas Index.where
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.