Teradata Package for Python Function Reference on VantageCloud Lake - TDAnalyticResult - 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.03
- Published
- December 2024
- Language
- English (United States)
- Last Update
- 2024-12-19
- dita:id
- TeradataPython_FxRef_Lake_2000
- Product Category
- Teradata Vantage
- teradataml.dataframe.dataframe.TDAnalyticResult.__init__ = __init__(self, data, id_sequence=None, payload_field=None, payload_content=None, layer=None)
- DESCRIPTION:
1. Create a TDAnalyticResult object from a teradataml Dataframe created on an
Analytic Result Table (ART) which can be used as input to
Unbounded Array Framework functions.
The primary use of an analytical result table (ART) is to
associate function results with a name label, enabling us to
easily retrieve the result data and pass the result to another
UAF function.
An ART can have multiple layers.
Each layer has its own dedicated row composition for the series
or matrix.
TDSeries object created using teradataml DataFrame on ART has
only data as the required argument, rest are optional.
2. Any operations like filter, select, sum, etc. over TDAnalyticResult
returns a teradataml DataFrame.
PARAMETERS:
data:
Required Argument.
Specifies the teradataml Dataframe.
Types: teradataml DataFrame
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, if dataframe is
created on ART.
Types: str
RAISES:
None
RETURNS:
None
EXAMPLES:
# Example 1: Creating an Art Spec on an Analytic Result Table (ART).
>>> load_example_data("dataframe", "ocean_buoys")
# Create an Analytic Result Table (ART) by executing UAF function.
>>> con.execute("EXECUTE FUNCTION INTO ART(TSINFO_RESULTS)
TD_SINFO(SERIES_SPEC (TABLE_NAME(OCEAN_BUOYS),
ROW_AXIS(TIMECODE(TD_TIMECODE)),
SERIES_ID(BuoyID), PAYLOAD(FIELDS(Salinity),CONTENT(REAL))));")
<sqlalchemy.engine.cursor.LegacyCursorResult object at 0x000002366F2D9460>
# Create a DataFrame on an ART
>>> art_df = DataFrame("TSINFO_RESULTS")
# Check if the DataFrame 'art_table' is created on an ART.
>>> art_df.is_art
True
# Create TDAnalyticResult object which can be used as ART_SPEC input in UAF functions.
>>> result = TDAnalyticResult(data=art_df)
# Check if 'result' is created on an ART.
>>> result.is_art
True
>>> result
buoyid ROW_I INDEX_DT INDEX_BEGIN INDEX_END NUM_ENTRIES DISCRETE SAMPLE_INTERVAL CONTENT MIN_MAG_salinity MAX_MAG_salinity AVG_MAG_salinity RMS_MAG_salinity HAS_NULL_NAN_INF
0 44 1 TIMESTAMP(6) 2014-01-06 10:00:24.000000 2014-01-06 10:52:00.000009 13 0 MICROSECONDS(258000001) REAL 55.0 55.0 55.0 55.0 N
1 0 1 TIMESTAMP(6) 2014-01-06 08:00:00.000000 2014-01-06 08:10:00.000000 5 0 SECONDS(150) REAL 55.0 55.0 55.0 55.0 N
2 2 1 TIMESTAMP(6) 2014-01-06 21:01:25.122200 2014-01-06 21:03:25.122200 3 1 MINUTES(1) REAL 55.0 55.0 55.0 55.0 N
3 1 1 TIMESTAMP(6) 2014-01-06 09:01:25.122200 2014-01-06 09:03:25.122200 6 0 SECONDS(24) REAL 55.0 55.0 55.0 55.0 N