Why choropleth mapbox, using animation, not show all discrete values from a dataframe?

32 Views Asked by At

I'm trying to plot a map using this dataframe (df_FR_1)

enter image description here

My problem is when I try to use choropleth_mapbox like this :

px.choropleth_mapbox(df_FR_1, geojson = geo_reg, locations = 'Code', color = 'Range de veillisement',
                    #color_discrete_map = col_dis_mp,
                    featureidkey="properties.code", mapbox_style="white-bg",
                    center = {'lat': 46.5, 'lon': -0.1}, zoom = 4.1, animation_frame = 'Year'
                    )

I cannot understand why the plot gives only 2 discrete values, when in total there are 3 :

enter image description here

So the final plot gives me errors like this :

enter image description here

There are values for all years and all Colum 'Code'.

Can someone help me please ?

Thanks in advance, Jorge

0

There are 0 best solutions below