isna()/notna() and isnull()/notnull() Methods | Teradata Python Package - NA Checking: isna()/notna() and isnull()/notnull() Methods - Teradata Package for Python

Teradata® Package for Python User Guide

Product
Teradata Package for Python
Release Number
17.10
Published
May 2022
Language
English (United States)
Last Update
2022-08-18
dita:mapPath
rsu1641592952675.ditamap
dita:ditavalPath
ayr1485454803741.ditaval
dita:id
B700-4006
lifecycle
previous
Product Category
Teradata Vantage

Missing values in data can be handled by using the isna() or notna() methods. Currently, the only NA value supported is None. 'isnull' and 'notnull' are aliases of 'isna' and 'notna' respectively. Other possible NA values, +Inf, -Inf, and NaN (typically seen in floating point calculations) are not supported. See the Teradata Package for Python Limitations and Considerations section for more information.

Example

>>> df = DataFrame('iris')
>>> df
           SepalLength  SepalWidth  PetalLength  PetalWidth            Name                                                 
0                 5.800       2.700        5.100        1.90  Iris-virginica
1                 6.500       3.000        5.800        2.20  Iris-virginica
2                 1.012       1.202        3.232        4.23            None
3                 5.400       3.700        1.500        0.20     Iris-setosa
4                 6.700       2.500        5.800        1.80  Iris-virginica
5                 7.200       3.600        6.100        2.50  Iris-virginica
>>> df.assign(drop_columns = True, Name = df.Name, NullName = df.Name.isna())
 
 
             Name NullName
0            None        1
1  Iris-virginica        0
2  Iris-virginica        0
3  Iris-virginica        0
4  Iris-virginica        0
5  Iris-virginica        0