✊🏿 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!

Memory Error when animating choropleth map

Hey folks.

I’m trying to make a choropleth map with plotly express. static map works and is rendered well.

But when I’m trying to animate it then I get “Memory Error”.
my dataset is not too large (2497 rows x 4 columns).

the code is as follow:

df = pd.read_csv("ca_pr_day.csv")
with open("canada_provinces.geojson", "r") as geo:
    mp = json.load(geo)

fig = px.choropleth(df,
                    locations="cartodb_id",
                    geojson=mp,
                    featureidkey="properties.cartodb_id",
                    color="cases",
                    animation_frame="date",
                    scope='north america',
                    )

fig.update_geos(showcountries=False, showcoastlines=False,
                showland=False, fitbounds="locations")
fig.show()

I’m using Pycharm on Windows 10.

Also FYI when I upgraded python to 64-bit, when I run the code it is opened in the browser and show the time frames and the map but when I press play the regions are getting disappeared. (I think when it gets value, the values layer cannot be rendered on the map perhaps). I tried with Jupyter but it was the same.

I previously was able to do animated choropleth maps but not sure why this happens now.