✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
⚡️ Concerned about the grid? Kyle Baranko teaches how to predicting peak loads using XGBoost. Register for the August webinar!

Choropleth map from Belgium and it's provinces drawing 1 province and filling background


For a project I need to draw a map from Belgium and it’s provinces.
I used the following geojson file:https://raw.githubusercontent.com/mathiasleroy/Belgium-Geographic-Data/master/dist/polygons/geojson/Belgium.provinces.WGS84.geojson
When I test the file on geojson.io I get the following result:

When I draw the map using plotly I get the following result:

The code I use to draw the map is the following:

import plotly.express as px

import json

import pandas as pd

df = pd.read_csv("data/resulted_data/kmeans/CLUSTER_PROVINCES.csv")

with open('geojson.json') as file:

    be = json.load(file)

fig = px.choropleth(df, geojson=be, locations="PROVINCE", featureidkey="properties.NameDUT", projection="mercator", color="CLUSTER", hover_data=["PROVINCE", "INFECTION_RATE", "HOSPITALISATION_RATE", "TEST_POS_PERCENTAGE", "CLUSTER"])



I have no idea why it succeeds to draw one province and then fills the background with one color.

I’ve already noticed that when I’m drawing one province at a time it leaves the province blank and fills the outside of the shape. Is there any way I can inverse this?