DataFrame.from_table() Function - Teradata Python Package

Teradata® Python Package User Guide

Product
Teradata Python Package
Release Number
16.20
Published
February 2020
Language
English (United States)
Last Update
2020-02-29
dita:mapPath
rkb1531260709148.ditamap
dita:ditavalPath
Generic_no_ie_no_tempfilter.ditaval
dita:id
B700-4006
lifecycle
previous
Product Category
Teradata Vantage
You can also use the DataFrame.from_table() function to create a teradataml DataFrame from an existing table or view in Vantage.

Example: Create a teradataml DataFrame

>>> df = DataFrame.from_table("sales")
>>> df
              Feb   Jan   Mar   Apr  datetime
accounts                                    
Alpha Co    210.0   200   215   250  04/01/2017
Blue Inc     90.0    50    95   101  04/01/2017
Yellow Inc   90.0  None  None  None  04/01/2017
Jones LLC   200.0   150   140   180  04/01/2017
Red Inc     200.0   150   140  None  04/01/2017
Orange Inc  210.0  None  None   250  04/01/2017

Example: Create a teradataml DataFrame with 'index_label'

>>> df = DataFrame.from_table("sales", index_label="Feb")
>>> df
         accounts   Jan   Mar   Apr  datetime
Feb                                         
90.0     Blue Inc    50    95   101  04/01/2017
210.0  Orange Inc  None  None   250  04/01/2017
200.0     Red Inc   150   140  None  04/01/2017
90.0   Yellow Inc  None  None  None  04/01/2017
200.0   Jones LLC   150   140   180  04/01/2017
210.0    Alpha Co   200   215   250  04/01/2017