DataFrame.max
- DataFrame.max(numeric_only: bool | None = None) Series
Return the maximum value for each numeric column
TODO - implement remainder of pandas arguments, currently non-numerics are not supported
Parameters
- numeric_only: {True, False, None} Default is None
Which datatype to be returned - True: Returns all values as float64, NaN/NaT values are removed - None: Returns all values as the same dtype where possible, NaN/NaT are removed - False: Returns all values as the same dtype where possible, NaN/NaT are preserved
Returns
- pandas.Series
max value for each numeric column
See Also
Examples
>>> from tests import OPENSEARCH_TEST_CLIENT
>>> df = oml.DataFrame(OPENSEARCH_TEST_CLIENT, 'flights', columns=["AvgTicketPrice", "Cancelled", "dayOfWeek", "timestamp", "DestCountry"]) >>> df.max() AvgTicketPrice 1199.73 Cancelled True dayOfWeek 6 timestamp 2018-02-11 23:50:12 dtype: object
>>> df.max(numeric_only=True) AvgTicketPrice 1199.729004 Cancelled 1.000000 dayOfWeek 6.000000 dtype: float64
>>> df.max(numeric_only=False) AvgTicketPrice 1199.73 Cancelled True dayOfWeek 6 timestamp 2018-02-11 23:50:12 DestCountry NaN dtype: object