asc | Teradata Package for Python - asc - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

Use the asc() function to generate a new ColumnExpression which sorts the actual expression in ascending order.

  • This function is supported only while sorting data.
  • This function is neither supported in projection nor supported in filtering data.

Example

>>> from teradataml import load_example_data
>>> load_example_data("dataframe","sales")
>>> df = DataFrame.from_table('sales')
>>> df.csum(sort_columns=[df.accounts, df.Feb.asc()], drop_columns=True)
   csum_Feb  csum_Jan  csum_Mar  csum_Apr
0     380.0     200.0     235.0     281.0
1     790.0     350.0     375.0     531.0
2    1000.0     550.0     590.0     781.0
3     580.0     350.0     375.0     281.0
4     180.0      50.0      95.0     101.0
5      90.0       NaN       NaN       NaN