Using SQLAlchemy ClauseElement and Expression in DataFrame.assign() | teradataml - Using Basic SQLAlchemy ClauseElement and Expression in DataFrame.assign() - Teradata Package for Python

Teradata® Package for Python User Guide

Product
Teradata Package for Python
Release Number
17.00
Published
November 2021
Language
English (United States)
Last Update
2022-01-14
dita:mapPath
bol1585763678431.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
B700-4006
lifecycle
previous
Product Category
Teradata Vantage

With the help of SQLAlchemy, in teradataml, user not only can run SQL functions, but also can run some other features that Vantage offers. Basically, user can use SQLAlchemy ClauseElments, representing select_expression clauses in query.

teradataml can use SQLAlchemy ClauseElements to do following:

  • Build a CASE expression on teradataml DataFrame column and select the using DataFrame.assign().
  • Cast a teradataml DataFrame column.
  • Select distinct values from a teradataml DataFrame Column.
  • Extract values from teradataml column, using EXTRACT function.

Refer to example notebook <pkg_install_location>\teradataml\data\notebooks\sqlalchemy\teradataml assign() - Using Generic SQLAlchemy ClauseElements (Case, Cast, Extract, Distinct).ipynb to learn about these.