Teradata Package for Python Function Reference on VantageCloud Lake | 17.20 - from_table - Teradata Package for Python - Look here for syntax, methods and examples for the functions included in the Teradata Package for Python.

Teradata® Package for Python Function Reference on VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Package for Python
Release Number
17.20
Publication Date
November 2022
Content Type
Programming Reference
Publication ID
B700-4500-112K
ft:locale
en-US
ft:lastEdition
2024-02-21
ft:sourceId
FTML
dita:id
TeradataPython_FxRef_Lake_1720
Product Category
Teradata Vantage
teradataml.dataframe.dataframe.DataFrame.from_table = from_table(table_name, index=True, index_label=None) method of builtins.type instance
Class method for creating a DataFrame from a table or a view.
 
PARAMETERS:
    table_name:
        Required Argument.
        The table name in Teradata Vantage referenced by this DataFrame.
        Types: str
 
    index:
        Optional Argument.
        True if using index column for sorting otherwise False.
        Default Value: True
        Types: bool
 
    index_label:
        Optional
        Column/s used for sorting.
        Types: str
 
EXAMPLES:
    from teradataml.dataframe.dataframe import DataFrame
 
    # Example 1: The following example creates a DataFrame from a table or
                 a view.
    # Load the example data.
    load_example_data("dataframe","sales")
 
    # Create DataFrame from table
    df = DataFrame.from_table('sales')
 
    # Create DataFrame from table and without index column sorting.
    df = DataFrame.from_table("sales", False)
 
    # Create DataFrame from table and sorting using the 'accounts'
    # column.
    df = DataFrame.from_table("sales", True, "accounts")
 
    # Example 2: The following example creates a DataFrame from existing Vantage
    #            table "dbcinfo" in the non-default database "dbc" using the
    #            in_schema() function.
 
    from teradataml.dataframe.dataframe import in_schema
    df = DataFrame.from_table(in_schema("dbc", "dbcinfo"))
 
RETURNS:
    DataFrame
 
RAISES:
    TeradataMlException - TDMLDF_CREATE_FAIL