Teradata Package for Python Function Reference | 20.00 - __rtruediv__ - 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.sql.DataFrameColumn.__rtruediv__ = __rtruediv__(self, other)
Compute the division between two ColumnExpressions using /.
 
PARAMETERS:
    other:
        Required Argument.
        Specifies Python literal or another ColumnExpression.
        Types: ColumnExpression, Python literal
 
RETURNS:
    ColumnExpression
 
RAISES:
    Exception
        A TeradataMlException gets thrown if SQLAlchemy
        throws an exception when evaluating the expression.
 
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: Divide the income by 2 and assign the divided income to new column 'divided_income'.
    >>> df.assign(divided_income=df.income / 2)
       start_time_column end_time_column  expenditure  income  investment  divided_income
    id
    3           67/06/30        07/07/10        434.0   485.0       185.0           242.5
    2           67/06/30        07/07/10        421.0   465.0       179.0           232.5
    1           67/06/30        07/07/10        415.0   451.0       180.0           225.5
    5           67/06/30        07/07/10        459.0   509.0       211.0           254.5
    4           67/06/30        07/07/10        448.0   493.0       192.0           246.5
 
    # Example 2: Calculate the percent of investment of income and assign the
    #            final amount to new column 'divided_income'.
    >>> df.assign(divided_income=df.investment * 100 / df.income)
       start_time_column end_time_column  expenditure  income  investment  divided_income
    id
    3           67/06/30        07/07/10        434.0   485.0       185.0       38.144330
    2           67/06/30        07/07/10        421.0   465.0       179.0       38.494624
    1           67/06/30        07/07/10        415.0   451.0       180.0       39.911308
    5           67/06/30        07/07/10        459.0   509.0       211.0       41.453831
    4           67/06/30        07/07/10        448.0   493.0       192.0       38.945233