Teradata Package for Python Function Reference | 20.00 - mode - Teradata Package for Python - Look here for syntax, methods and examples for the functions included in the Teradata Package for Python.

Teradata® Package for Python Function Reference - 20.00

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for Python
Release Number
20.00.00.03
Published
December 2024
ft:locale
en-US
ft:lastEdition
2024-12-19
dita:id
TeradataPython_FxRef_Enterprise_2000
Product Category
Teradata Vantage
teradataml.dataframe.sql.DataFrameColumn.mode = mode(self, **kwargs)
DESCRIPTION:
    Function to get the mode value for a column.
    Note:
        This can only be used as Time Series Aggregate function.
 
PARAMETERS:
    kwargs:
        Specifies optional keyword arguments.
 
RETURNS:
     ColumnExpression
 
RAISES:
    RuntimeError - If column does not support the aggregate operation.
 
EXAMPLES:
    >>> # Load the example datasets.
    ... load_example_data("dataframe", ["ocean_buoys", "ocean_buoys_seq", "ocean_buoys_nonpti"])
 
    # Example 1: Executing mode function on DataFrame column created on non-sequenced PTI table.
    >>> # Create the required DataFrames.
    ... # DataFrame on non-sequenced PTI table
    ... ocean_buoys = DataFrame("ocean_buoys")
 
    >>> ocean_buoys_grpby1 = ocean_buoys.groupby_time(timebucket_duration="10m",
    ...                                               value_expression="buoyid", fill="NULLS")
    >>> ocean_buoys_grpby1.temperature.mode()