admin管理员组

文章数量:1400182

i'm currently working with geopandas and geodatasets to plot the countries from gnomad data. I have a gdf dataframe containing the countries, latitude, longitude, counts (of individuals) and geometry points. On the other side, I have the world map from .1/catalog/datasets/natural-earth-countries-1_110m/exports/geojson?lang=en&timezone=America%2FArgentina%2FBuenos_Aires

So I merge those two dataframes with

worldn = world.merge(gdf, left_on='name', right_on='countries', how='left')

The plot is functioning but that are some countries that are not present in the world dataframe such as: ["Puerto Rico", "Barbados", "Palestine" and "Scotland"]

How do I deal with that? the geometry points in gdf are writed as

POINT (104.1954 35.8617)

and in world dataframe is

POLYGON ((22.55814 49.08574, 22.28084 48.82539...

or 

MULTIPOLYGON (((-122.84 49, -120 49, -117.0312...

本文标签: pythonHow to manage missing countries in geodatasetsStack Overflow