Teradata Package for Python Function Reference | 20.00 - __or__ - 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.__or__ = __or__(self, other)
Compute the logical OR between two ColumnExpressions using |.
The logical OR operator is an operator that performs a
inclusive disjunction on two statements.
 
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("dataframe", "admissions_train")
    >>> df = DataFrame("admissions_train")
    >>> df
       masters   gpa     stats programming  admitted
    id
    15     yes  4.00  Advanced    Advanced         1
    40     yes  3.95    Novice    Beginner         0
    7      yes  2.33    Novice      Novice         1
    22     yes  3.46    Novice    Beginner         0
    38     yes  2.65  Advanced    Beginner         1
    26     yes  3.57  Advanced    Advanced         1
    5       no  3.44    Novice      Novice         0
    24      no  1.87  Advanced      Novice         1
    39     yes  3.75  Advanced    Beginner         0
    30     yes  3.79  Advanced      Novice         0
 
    # Example 1: Get all students with gpa greater than
    #            3.5 or 'Advanced' programming skills.
    >>> df[(df.gpa > 3.5) | (df.programming == "Advanced")]
       masters   gpa     stats programming  admitted
    id
    30     yes  3.79  Advanced      Novice         0
    40     yes  3.95    Novice    Beginner         0
    39     yes  3.75  Advanced    Beginner         0
    37      no  3.52    Novice      Novice         1
    26     yes  3.57  Advanced    Advanced         1
    3       no  3.70    Novice    Beginner         1
    1      yes  3.95  Beginner    Beginner         0
    20     yes  3.90  Advanced    Advanced         1
    35      no  3.68    Novice    Beginner         1
    14     yes  3.45  Advanced    Advanced         0