bigframes.pandas.DataFrame.isnull#
- DataFrame.isnull()→DataFrame#
Detect missing (NULL) values.
Return a boolean same-sized object indicating if the values are NA(NULL in BigQuery). NA/NULL values get mapped to True values.Everything else gets mapped to False values.
Note that empty strings
'',numpy.inf, andnumpy.nanare*not* considered NA values. This NA/NULLlogic differs from numpy, but it is the same as BigQuery and thepandas.ArrowDtype.Examples:
>>>df=bpd.DataFrame(dict(...age=pd.Series(pa.array(...[5,6,None,4],...type=pa.int64(),...),dtype=pd.ArrowDtype(pa.int64())),...born=pd.to_datetime([pd.NA,"1940-04-25","1940-04-25","1941-08-25"]),...name=['Alfred','Batman','','Plastic Man'],...toy=[None,'Batmobile','Joker','Play dough'],...height=pd.Series(pa.array(...[6.1,5.9,None,np.nan],...type=pa.float64(),...),dtype=pd.ArrowDtype(pa.float64())),...))>>>df age born name toy height0 5 <NA> Alfred <NA> 6.11 6 1940-04-25 00:00:00 Batman Batmobile 5.92 <NA> 1940-04-25 00:00:00 Joker <NA>3 4 1941-08-25 00:00:00 Plastic Man Play dough NaN[4 rows x 5 columns]
Show which entries in a DataFrame are NA (NULL in BigQuery):
>>>df.isna() age born name toy height0 False True False True False1 False False False False False2 True False False False True3 False False False False False[4 rows x 5 columns]
>>>df.isnull() age born name toy height0 False True False True False1 False False False False False2 True False False False True3 False False False False False[4 rows x 5 columns]
Show which entries in a Series are NA (NULL in BigQuery):
>>>ser=bpd.Series(pa.array(...[5,None,6,np.nan,None],...type=pa.float64(),...),dtype=pd.ArrowDtype(pa.float64()))>>>ser0 5.01 <NA>2 6.03 NaN4 <NA>dtype: Float64
>>>ser.isna()0 False1 True2 False3 False4 Truedtype: boolean
>>>ser.isnull()0 False1 True2 False3 False4 Truedtype: boolean
- Returns:
Mask of bool values for each element that indicates whether anelement is an NA value.
- Return type:
On this page