Teradata Package for Python Function Reference | 20.00 - desc - 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.desc = desc(self)
DESCRIPTION:
    Generates a new _SQLColumnExpression which sorts the actual
    expression in Descending Order.
    Note:
        This function is supported only while sorting the Data. This
        function is neither supported in projection nor supported in
        filtering the Data.
 
RAISES:
    None
 
RETURNS:
    ColumnExpression
 
EXAMPLES:
    >>> load_example_data("dataframe","sales")
    >>> df = DataFrame.from_table('sales')
 
    >>> load_example_data("dataframe","sales")
    >>> df = DataFrame.from_table('sales')
 
    # Sorts the Data on column accounts in ascending order and column
    # Feb in descending order, then calculates moving average by dropping
    # the input DataFrame columns on the window of size 2.
    >>> df.mavg(width=2, sort_columns=[df.accounts, df.Feb.desc()], drop_columns=True)
       mavg_Feb  mavg_Jan  mavg_Mar  mavg_Apr mavg_datetime
    0     145.0     100.0     117.5     140.5    04/01/2017
    1     205.0     150.0     140.0     250.0    04/01/2017
    2     145.0     150.0     140.0       NaN    04/01/2017
    3     205.0     150.0     140.0     215.0    04/01/2017
    4     150.0     125.0     155.0     175.5    04/01/2017
    5     210.0     200.0     215.0     250.0    04/01/2017