Example Setup - Teradata Package for Python

Teradata® Package for Python User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for Python
Release Number
20.00
Published
December 2024
ft:locale
en-US
ft:lastEdition
2025-01-23
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
Product Category
Teradata Vantage

Load the data and create a DataFrame on 'sales' table.

>>> load_example_data("dataframe", "sales")
>>> import random
>>> dfsales = DataFrame("sales")
>>> df = dfsales.assign(id = case([(df.accounts == 'Alpha Co', random.randrange(1, 9)),
...                           (df.accounts == 'Blue Inc', random.randrange(1, 9)),
...                           (df.accounts == 'Jones LLC', random.randrange(1, 9)),
...                           (df.accounts == 'Orange Inc', random.randrange(1, 9)),
...                           (df.accounts == 'Yellow Inc', random.randrange(1, 9)),
...                           (df.accounts == 'Red Inc', random.randrange(1, 9))]))
>>>