Teradata Package for Python Function Reference on VantageCloud Lake | 17.20 - isnull - 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.isnull = isnull(self)
Test for NA values. Alias for isna()
 
PARAMETERS:
    None
 
RETURNS:
    When used with assign() function, newly assigned column contains
    A boolean Series of numeric values:
      - 1 if value is NA (None)
      - 0 if values is not NA
    Otherwise returns ColumnExpression, also known as, teradataml DataFrameColumn.
 
EXAMPLES:
    >>> load_example_data("dataframe", "sales")
    >>> df = DataFrame("sales")
 
    # Example 1: Filter out the NA values from 'Mar' column.
    >>> df[df.Mar.isnull() == 1]
                  Feb   Jan   Mar    Apr    datetime
    accounts
    Orange Inc  210.0  None  None  250.0  04/01/2017
    Yellow Inc   90.0  None  None    NaN  04/01/2017
 
    # Filter out the non-NA values from 'Mar' column.
    >>> df[df.Mar.isnull() == 0]
                 Feb  Jan  Mar    Apr    datetime
    accounts
    Blue Inc    90.0   50   95  101.0  04/01/2017
    Red Inc    200.0  150  140    NaN  04/01/2017
    Jones LLC  200.0  150  140  180.0  04/01/2017
    Alpha Co   210.0  200  215  250.0  04/01/2017
 
    # Example 2: Filter out the NA values from 'Mar' column using boolean True.
    >>> df[df.Mar.isnull() == True]
                  Feb   Jan   Mar    Apr    datetime
    accounts
    Orange Inc  210.0  None  None  250.0  04/01/2017
    Yellow Inc   90.0  None  None    NaN  04/01/2017
 
    # Filter out the non-NA values from 'Mar' column using boolean False.
    >>> df[df.Mar.isnull() == False]
                 Feb  Jan  Mar    Apr    datetime
    accounts
    Blue Inc    90.0   50   95  101.0  04/01/2017
    Red Inc    200.0  150  140    NaN  04/01/2017
    Jones LLC  200.0  150  140  180.0  04/01/2017
    Alpha Co   210.0  200  215  250.0  04/01/2017
 
    # Example 3: Assign the tested values to dataframe as a column.
    >>> df.assign(isnull_=df.Mar.isnull())
                  Feb    Jan    Mar    Apr    datetime isnull_
    accounts
    Blue Inc     90.0   50.0   95.0  101.0  04/01/2017     0
    Orange Inc  210.0    NaN    NaN  250.0  04/01/2017     1
    Red Inc     200.0  150.0  140.0    NaN  04/01/2017     0
    Yellow Inc   90.0    NaN    NaN    NaN  04/01/2017     1
    Jones LLC   200.0  150.0  140.0  180.0  04/01/2017     0
    Alpha Co    210.0  200.0  215.0  250.0  04/01/2017     0