Teradata Package for Python Function Reference on VantageCloud Lake | 17.20 - __radd__ - 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.sql.DataFrameColumn.__radd__ = __radd__(self, other)
Compute the rhs sum between two ColumnExpressions using +
 
PARAMETERS:
    other:
        Required Argument.
        Specifies Python literal or another ColumnExpression.
        Types: ColumnExpression, Python literal
 
RETURNS:
    ColumnExpression
 
EXAMPLES:
    >>> load_example_data("burst", "finance_data")
    >>> df = DataFrame("finance_data")
    >>> df
       start_time_column end_time_column  expenditure  income  investment
    id
    1           67/06/30        07/07/10        415.0   451.0       180.0
    4           67/06/30        07/07/10        448.0   493.0       192.0
    2           67/06/30        07/07/10        421.0   465.0       179.0
    3           67/06/30        07/07/10        434.0   485.0       185.0
    5           67/06/30        07/07/10        459.0   509.0       211.0
    
    # Example 1: Add 100 to the expenditure amount and assign the final amount
    #            to new column 'total_expenditure'.
    >>> df.assign(total_expenditure=df.expenditure + 100)
       start_time_column end_time_column  expenditure  income  investment  total_expenditure
    id
    3           67/06/30        07/07/10        434.0   485.0       185.0              534.0
    2           67/06/30        07/07/10        421.0   465.0       179.0              521.0
    1           67/06/30        07/07/10        415.0   451.0       180.0              515.0
    5           67/06/30        07/07/10        459.0   509.0       211.0              559.0
    4           67/06/30        07/07/10        448.0   493.0       192.0              548.0
 
    # Example 2: Add expenditure amount to the investment amount and assign the
    #            final amount to new column 'total_investmet'.
    >>> df.assign(total_investmet=df.expenditure + df.investment)
       start_time_column end_time_column  expenditure  income  investment  total_investmet
    id
    3           67/06/30        07/07/10        434.0   485.0       185.0                        619.0
    2           67/06/30        07/07/10        421.0   465.0       179.0                        600.0
    1           67/06/30        07/07/10        415.0   451.0       180.0                        595.0
    5           67/06/30        07/07/10        459.0   509.0       211.0                        670.0
    4           67/06/30        07/07/10        448.0   493.0       192.0                        640.0