Teradata Package for Python Function Reference on VantageCloud Lake - 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
20.00.00.04
Published
March 2025
ft:locale
en-US
ft:lastEdition
2025-04-11
dita:id
TeradataPython_FxRef_Lake_2000
Product Category
Teradata Vantage
teradataml.dataframe.dataframe.DataFrame.from_table = from_table(table_name, index=True, index_label=None, schema_name=None, datalake_name=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
 
    schema_name:
        Optional Argument.
        Specifies the schema where the table resides.
        Types: str
 
    datalake_name:
        Optional Argument.
        Specifies the datalake name.
        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"))
 
    # Example 3: Create a DataFrame on existing DataLake
    #            table "lake_table" in the "datalake_database" database
    #            in "datalake" datalake.
 
    >>> datalake_df = DataFrame.from_table(table_name="lake_table",
    ...                                    schema_name="datalake_database",
    ...                                    datalake_name="datalake" )
 
RETURNS:
    DataFrame
 
RAISES:
    TeradataMlException - TDMLDF_CREATE_FAIL