Teradata Package for Python Function Reference | 20.00 - __rmod__ - 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
Published
March 2024
Language
English (United States)
Last Update
2024-04-10
dita:id
TeradataPython_FxRef_Enterprise_2000
Product Category
Teradata Vantage
teradataml.dataframe.sql.DataFrameColumn.__rmod__ = __rmod__(self, other)
Compute the MOD between two ColumnExpressions using %.
Note: string types already override the __mod__ . We cannot override it
      if the string type is the left operand.
 
PARAMETERS:
    other :
        Required Argument.
        Specifies Python literal or another ColumnExpression.
        Types: ColumnExpression
 
RETURNS:
    ColumnExpression, Python literal
 
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: Calculate the reminder by taking mod of 2 on income and assign the
    #            reminder to new column 'reminder'.
    >>> df.assign(reminder=df.income.mod(2))
       start_time_column end_time_column  expenditure  income  investment   reminder
    id
    3           67/06/30        07/07/10        434.0   485.0       185.0        1.0
    2           67/06/30        07/07/10        421.0   465.0       179.0        1.0
    1           67/06/30        07/07/10        415.0   451.0       180.0        1.0
    5           67/06/30        07/07/10        459.0   509.0       211.0        1.0
    4           67/06/30        07/07/10        448.0   493.0       192.0        1.0