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
- A boolean pandas Series of the same size as the GeoSeries,
- True where a value is NA.
>>> 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