teradataml is a Python package that provides an interface to perform advanced analytics on Teradata Vantage. It allows users to leverage the massive parallel processing capabilities of Teradata Vantage for data manipulation, transformation, and various analytic functions without extensive SQL coding. The current version is 20.0.0.10, and it receives frequent minor updates within its major releases.
pip install teradatamlVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to establish a connection to Teradata Vantage using `create_context`, create a teradataml DataFrame from an existing table, and display its head. It uses environment variables for sensitive connection details.
Manually install required optional dependencies: `pip install teradataml[feature_name]`.
Avoid creating or using table names that begin with digits when using `fastload()`. Consider using `copy_to_sql()` or pandas `to_sql()` instead if this is an issue.
Upgrade `teradatasql` (`pip install -U --no-cache-dir teradatasql`) or, for older `teradataml` versions, pass `encryptdata='true'` via a SQLAlchemy engine to `create_context`.
Use `pip install --no-cache-dir -U teradataml` for upgrades.
Update code that relies on the return value of `set_auth_token` to expect the class object, or adjust logic if a boolean check was previously performed.
Refer to the Teradata Python Package User Guide for updated analytic function names and structures.
Use `sqlalchemy.create_engine('teradatasql://...')` for creating the engine.pip install teradataml
from teradataml import tdml tdml.configure(host="your_vantage_hostname", username="your_username", password="your_password", logmech='LDAP' # if required, other params like port, driver_path can be added) # Ensure 'your_vantage_hostname', 'your_username', 'your_password' are correct and the Vantage system is accessible.
from teradataml import DataFrame my_teradata_df = DataFrame(table_name="my_table") # Use teradataml's in-database functions or convert to pandas for local processing # Example for local processing: pandas_df = my_teradata_df.to_pandas() pandas_df.fillna(0, inplace=True) # For in-database operations, use teradataml's built-in analytic functions or methods.
from teradataml import DataFrame my_teradata_df = DataFrame(table_name="my_table") # Verify the exact column names available in the DataFrame print(my_teradata_df.columns) # Correct the column name in your code based on the available columns selected_df = my_teradata_df.select(['ExistingColumn1', 'ExistingColumn2'])