Teradata Package for Python Function Reference | 20.00 - TDSeries - 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 - 20.00

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for Python
Release Number
20.00.00.03
Published
December 2024
ft:locale
en-US
ft:lastEdition
2024-12-19
dita:id
TeradataPython_FxRef_Enterprise_2000
lifecycle
latest
Product Category
Teradata Vantage
teradataml.dataframe.dataframe.TDSeries.__init__ = __init__(self, data, id, row_index, row_index_style='TIMECODE', id_sequence=None, payload_field=None, payload_content=None, layer=None, interval=None)
DESCRIPTION:
    1. Create a TDSeries object from a teradataml DataFrame
       representing a SERIES in time series which is used
       as input to Unbounded Array Framework, time series functions.
 
       A series is a one-dimensional array. They are the basic input
       of UAF functions.
       A series is identified by its series ID, i.e., "id" argument,
       and indexed by "row_index" argument.
 
       Series is passed to and returned from UAF functions as wavelets.
       Wavelets are collections of rows, grouped by one or more fields,
       and ordered on the "row_index" argument.
 
    2. Any operations like filter, select, sum, etc. over TDSeries
       returns a teradataml DataFrame.
 
PARAMETERS:
    data:
        Required Argument.
        Specifies the teradataml Dataframe.
        Types: teradataml DataFrame
 
    id:
        Required Argument.
        Specifies the name of the column in "data" containing the
        identifier values.
        Types: str or list of str
 
    row_index:
        Required Argument.
        Specifies the name of the column in "data" containing the
        row indexing values.
        Types: str
 
    row_index_style:
        Optional Argument.
        Specifies the style of row indexing.
        Default Value: "TIMECODE"
        Permitted Values: "TIMECODE", "SEQUENCE"
        Types: str
 
    id_sequence:
        Optional Argument.
        Specifies a sequence of series to plot.
        Types: str or list of str
 
    payload_field:
        Optional Argument.
        Specifies the names of the fields for payload.
        Types: str or list of str
 
    payload_content:
        Optional Argument.
        Specifies the payload content type.
        Permitted Values: "REAL", "COMPLEX", "AMPL_PHASE",
                          "AMPL_PHASE_RADIANS", "AMPL_PHASE_DEGREES",
                          "MULTIVAR_REAL", "MULTIVAR_COMPLEX",
                          "MULTIVAR_ANYTYPE", "MULTIVAR_AMPL_PHASE",
                          "MULTIVAR_AMPL_PHASE_RADIANS ",
                          "MULTIVAR_AMPL_PHASE_DEGREES"
        Types: str
 
    layer:
        Optional Argument.
        Specifies the layer name of the ART table, if dataframe is
        created on ART table.
        Types: str
 
    interval:
        Optional Argument.
        Specifies the indicator to divide a series into a collection of
        intervals along its row-axis.
        "interval" is categorised in to 4 types:
            * Values represent time-duration
                * Allowed Values:
                    * CAL_YEARS
                    * CAL_MONTHS
                    * CAL_DAYS
                    * WEEKS
                    * DAYS
                    * HOURS
                    * MINUTES
                    * SECONDS
                    * MILLISECONDS
                    * MICROSECONDS
            * Values represent time-zero
                * Allowed Values:
                    * DATE
                    * TIMESTAMP
                    * TIMESTAMP WITH TIME ZONE
            * Values represent an integer or floating number
                * Allowed Values: A positive integer or float,
                 range from 1 to 32767, inclusively.
            * sequence-zero:
                An expression which evaluates to an INTEGER or FLOAT.
                Used when row_index_style is SEQUENCE.
        Allowed Values:
            Individual values or combined values from below:
            * time-duration
            * time-duration, time-zero
            * integer
            * float, integer
            * sequence-zero
            * float, sequence-zero
        Types: str
 
RAISES:
    None
 
RETURNS:
    None
 
EXAMPLES:
    # Example 1: Creating TDSeries object.
    >>> from teradataml import create_context, load_example_data, DataFrame, TDSeries
    >>> con = create_context(host = host, user=user, password=passw)
    >>> load_example_data("dataframe", "admissions_train")
 
    # Create a DataFrame to be passed as input to TDSeries.
    >>> data = DataFrame("admissions_train")
 
    # Create TDSeries object which can be used as input in UAF functions.
    >>> result = TDSeries(data=data, id="admitted", row_index="admitted",
                          payload_field="abc", payload_content="REAL")
 
    >>> result
       masters   gpa     stats programming  admitted
    id
    5       no  3.44    Novice      Novice         0
    34     yes  3.85  Advanced    Beginner         0
    13      no  4.00  Advanced      Novice         1
    40     yes  3.95    Novice    Beginner         0
    22     yes  3.46    Novice    Beginner         0
    19     yes  1.98  Advanced    Advanced         0
    36      no  3.00  Advanced      Novice         0
    15     yes  4.00  Advanced    Advanced         1
    7      yes  2.33    Novice      Novice         1
    17      no  3.83  Advanced    Advanced         1