Teradata Package for Python Function Reference | 20.00 - RowNormalizeTransform - 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
Product Category
Teradata Vantage
 
 
RowNormalizeTransform

 
Functions
       
RowNormalizeTransform(data=None, object=None, accumulate=None, **generic_arguments)
DESCRIPTION:
    RowNormalizeTransform() function normalizes input columns row-wise, using
    RowNormalizeFit() function output.
 
PARAMETERS:
    data:
        Required Argument.
        Specifies the input teradataml DataFrame.
        Types: teradataml DataFrame
 
    object:
        Required Argument.
        Specifies the teradataml DataFrame containing the output generated by
        RowNormalizeFit() function or the instance of RowNormalizeFit.
        Types: teradataml DataFrame or RowNormalizeFit
 
    accumulate:
        Optional Argument.
        Specifies the names of input teradataml DataFrame columns to copy to the output.
        Types: str OR list of Strings (str)
 
    **generic_arguments:
        Specifies the generic keyword arguments SQLE functions accept.
        Below are the generic keyword arguments:
            persist:
                Optional Argument.
                Specifies whether to persist the results of the function in table or not.
                When set to True, results are persisted in table; otherwise, results
                are garbage collected at the end of the session.
                Default Value: False
                Types: boolean
 
            volatile:
                Optional Argument.
                Specifies whether to put the results of the function in volatile table or not.
                When set to True, results are stored in volatile table, otherwise not.
                Default Value: False
                Types: boolean
 
        Function allows the user to partition, hash, order or local order the input
        data. These generic arguments are available for each argument that accepts
        teradataml DataFrame as input and can be accessed as:
            * "<input_data_arg_name>_partition_column" accepts str or list of str (Strings)
            * "<input_data_arg_name>_hash_column" accepts str or list of str (Strings)
            * "<input_data_arg_name>_order_column" accepts str or list of str (Strings)
            * "local_order_<input_data_arg_name>" accepts boolean
        Note:
            These generic arguments are supported by teradataml if the underlying
            SQLE Engine function supports, else an exception is raised.
 
RETURNS:
    Instance of RowNormalizeTransform.
    Output teradataml DataFrames can be accessed using attribute
    references, such as RowNormalizeTransformObj.<attribute_name>.
    Output teradataml DataFrame attribute name is: result
 
RAISES:
    TeradataMlException, TypeError, ValueError
 
EXAMPLES:
    # Notes:
    #     1. Get the connection to Vantage to execute the function.
    #     2. One must import the required functions mentioned in
    #        the example from teradataml.
    #     3. Function will raise error if not supported on the Vantage
    #        user is connected to.
 
    # Load the example data.
    load_example_data("teradataml", ["numerics"])
 
    # Create teradataml DataFrame.
    numerics = DataFrame.from_table("numerics")
 
    # Check the list of available analytic functions.
    display_analytic_functions()
 
    # Example 1: Normalize "smallint_col" and "integer_col" columns using "INDEX"
    #            approach, "integer_col" as base column and base value as 100.
    fit_obj = RowNormalizeFit(data=numerics,
                              target_columns=["integer_col", "smallint_col"],
                              approach="INDEX",
                              base_column="integer_col",
                              base_value=100.0)
 
    # Print the result DataFrame.
    print(fit_obj.output)
    print(fit_obj.output_data)
 
    # Normalize the columns and accumulate the result by "id_col" column.
    obj = RowNormalizeTransform(data=numerics,
                                object=fit_obj.output,
                                accumulate="id_col")
 
    # Print the result DataFrame.
    print(obj.result)