Python | Pandas dataframe.max() Last Updated : 19 Nov, 2018 Summarize Comments Improve Suggest changes Share Like Article Like Report 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. Pandas dataframe.max() function returns the maximum of the values in the given object. If the input is a series, the method will return a scalar which will be the maximum of the values in the series. If the input is a dataframe, then the method will return a series with maximum of values over the specified axis in the dataframe. By default the axis is the index axis. Syntax: DataFrame.max(axis=None, skipna=None, level=None, numeric_only=None, **kwargs) Parameters : axis : {index (0), columns (1)} skipna : Exclude NA/null values when computing the result level : If the axis is a MultiIndex (hierarchical), count along a particular level, collapsing into a Series numeric_only : Include only float, int, boolean columns. If None, will attempt to use everything, then use only numeric data. Not implemented for Series. Returns : max : Series or DataFrame (if level specified) Example #1: Use max() function to find the maximum value over the index axis. Python3 # importing pandas as pd import pandas as pd # Creating the dataframe df = pd.DataFrame({"A":[12, 4, 5, 44, 1], "B":[5, 2, 54, 3, 2], "C":[20, 16, 7, 3, 8], "D":[14, 3, 17, 2, 6]}) # Print the dataframe df Let's use the dataframe.max() function to find the maximum value over the index axis Python3 1== # Even if we do not specify axis = 0, # the method will return the max over # the index axis by default df.max(axis = 0) Output : Example #2: Use max() function on a dataframe which has Na values. Also find the maximum over the column axis. Python3 # importing pandas as pd import pandas as pd # Creating the dataframe df = pd.DataFrame({"A":[12, 4, 5, None, 1], "B":[7, 2, 54, 3, None], "C":[20, 16, 11, 3, 8], "D":[14, 3, None, 2, 6]}) # skip the Na values while finding the maximum df.max(axis = 1, skipna = True) Output : Comment More infoAdvertise with us Next Article Python | Pandas dataframe.mode() S Shubham__Ranjan Follow Improve Article Tags : Technical Scripter Python Python-pandas Python pandas-dataFrame Pandas-DataFrame-Methods +1 More Practice Tags : python Similar Reads Python | Pandas dataframe.idxmax() 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. Pandas dataframe.idxmax() function returns index of first occurrence of maximum over r 2 min read Python | Pandas dataframe.mode() 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. Pandas dataframe.mode() function gets the mode(s) of each element along the axis selec 2 min read Python | Pandas DataFrame.nlargest() 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. Pandas nlargest() method is used to get n largest values from a data frame or a series 2 min read Python | Pandas dataframe.cummax() 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. Pandas dataframe.cummax() is used to find the cumulative maximum value over any axis. 2 min read Python | Pandas Index.max() 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. Pandas Index.max() function returns the maximum value of the Index. The function works 2 min read Pandas dataframe.aggregate() | Python Dataframe.aggregate() function is used to apply some aggregation across one or more columns. Aggregate using callable, string, dict or list of string/callables. The most frequently used aggregations are:sum: Return the sum of the values for the requested axismin: Return the minimum of the values for 2 min read Like