最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

python - How to manage missing countries in geodatasets - Stack Overflow

programmeradmin3浏览0评论

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...
发布评论

评论列表(0)

  1. 暂无评论