Teradata Package for Python Function Reference | 20.00 - last - 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
Published
March 2024
Language
English (United States)
Last Update
2024-04-10
dita:id
TeradataPython_FxRef_Enterprise_2000
Product Category
Teradata Vantage
teradataml.dataframe.sql.DataFrameColumn.last = last(self, **kwargs)
DESCRIPTION:
    Function returns newest value, determined by the timecode, for each group
    in 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"])
 
    >>> # Create the required DataFrames.
    ... # DataFrame on non-sequenced PTI table
    ... ocean_buoys = DataFrame("ocean_buoys")
 
    >>> ocean_buoys_grpby1 = ocean_buoys.groupby_time(timebucket_duration="2cd",
    ...                                               value_expression="buoyid", fill="NULLS")
 
    >>> ocean_buoys_grpby1.temperature.last()