geopandas.GeoSeries.isna

GeoSeries.isna()

Detect missing values.

Historically, NA values in a GeoSeries could be represented by empty geometric objects, in addition to standard representations such as None and np.nan. This behaviour is changed in version 0.6.0, and now only actual missing values return True. To detect empty geometries, use GeoSeries.is_empty instead.

Returns
A boolean pandas Series of the same size as the GeoSeries,
True where a value is NA.

See also

GeoSeries.notna

inverse of isna

GeoSeries.is_empty

detect empty geometries

Examples

>>> from shapely.geometry import Polygon
>>> s = geopandas.GeoSeries(
...     [Polygon([(0, 0), (1, 1), (0, 1)]), None, Polygon([])]
... )
>>> s
0    POLYGON ((0.00000 0.00000, 1.00000 1.00000, 0....
1                                                 None
2                             GEOMETRYCOLLECTION EMPTY
dtype: geometry
>>> s.isna()
0    False
1     True
2    False
dtype: bool