Teradata Package for Python Function Reference | 20.00 - isnan - 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.isnan = isnan(self)
DESCRIPTION:
    Function evaluates a variable or expression to determine if the
    floating-point argument is a NaN (Not-a-Number) value. When a database
    table contains a NaN value, the data is undefined and unrepresentable
    in floating-point arithmetic. For example, division by 0, or the square root
    of a negative number would return a NaN result.
 
RETURNS:
    ColumnExpression.
 
EXAMPLES:
    # Load the data to run the example.
    >>> load_example_data("teradataml","titanic")
 
    # Create a DataFrame on 'titanic' table.
    >>> titanic = DataFrame.from_table('titanic')
    >>> df = titanic.select(["passenger", "age", "fare"])
    >>> print(df)
                age      fare
    passenger
    326        36.0  135.6333
    183         9.0   31.3875
    652        18.0   23.0000
    40         14.0   11.2417
    774         NaN    7.2250
    366        30.0    7.2500
    509        28.0   22.5250
    795        25.0    7.8958
    61         22.0    7.2292
    469         NaN    7.7250
    >>>
 
    # Example 1: Find whether 'fare' column contains NaN values or not.
    >>> nan_df = df.assign(nanornot = df.fare.isnan())
    >>> print(nan_df)
                age      fare nanornot
    passenger
    326        36.0  135.6333        0
    183         9.0   31.3875        0
    652        18.0   23.0000        0
    40         14.0   11.2417        0
    774         NaN    7.2250        0
    366        30.0    7.2500        0
    509        28.0   22.5250        0
    795        25.0    7.8958        0
    61         22.0    7.2292        0
    469         NaN    7.7250        0
    >>>