Teradata Python Package Function Reference - max - Teradata Python Package - Look here for syntax, methods and examples for the functions included in the Teradata Python Package.
Teradata® Python Package Function Reference
- Product
- Teradata Python Package
- Release Number
- 16.20
- Published
- February 2020
- Language
- English (United States)
- Last Update
- 2020-07-17
- lifecycle
- previous
- Product Category
- Teradata Vantage
- teradataml.dataframe.dataframe.DataFrame.max = max(self)
- DESCRIPTION:
Returns column-wise maximum value of the dataframe.
PARAMETERS:
None
RETURNS:
teradataml DataFrame object with max()
operation performed.
RAISES:
TeradataMLException
1. TDMLDF_AGGREGATE_FAILED - If max() operation fails to
generate the column-wise maximum value of the dataframe.
Possible error message:
Unable to perform 'max()' on the dataframe.
2. TDMLDF_AGGREGATE_COMBINED_ERR - If the max() operation
doesn't support all the columns in the dataframe.
Possible error message:
No results. Below is/are the error message(s):
All selected columns [(col2 - PERIOD_TIME), (col3 -
BLOB)] is/are unsupported for 'max' operation.
EXAMPLES :
# Load the data to run the example.
>>> from teradataml.data.load_example_data import load_example_data
>>> load_example_data("dataframe", ["employee_info"])
# Create teradataml dataframe.
>>> df1 = DataFrame("employee_info")
>>> print(df1)
first_name marks dob joined_date
employee_no
101 abcde None None 02/12/05
100 abcd None None None
112 None None None 18/12/05
>>>
# Prints maximum value of each column(with supported data types).
>>> df1.max()
max_employee_no max_first_name max_marks max_dob max_joined_date
0 112 abcde None None 18/12/05
>>>
# Select only subset of columns from the DataFrame.
>>> df3 = df1.select(['employee_no', 'first_name', 'joined_date'])
# Prints maximum value of each column(with supported data types).
>>> df3.max()
max_employee_no max_first_name max_joined_date
0 112 abcde 18/12/05
>>>