0
votes

I am trying to create a plotly choropleth map of the uk local authorities, using predicted autism prevalence. The script is getting stuck infinitely loading when I try and assign "colour=predictedprevalence" so that the choropleth shows predicted autism rates from the dataset in each authority area. I am unsure what I need to do. I have attached an image of where the script hangs shows where the script hangs

import pandas as pd
import json
from urllib.request import urlopen
import numpy as np
#With Plotly
import plotly.express as px
from geojson_rewind import rewind

with urlopen('https://raw.githubusercontent.com/plummy95/1312306/main/localauth.json') as response:
    counties = json.load(response)

df=pd.read_csv('https://raw.githubusercontent.com/plummy95/1312306/main/localauth.json')

counties_corrected=rewind(counties,rfc7946=False)

fig = px.choropleth(df, geojson=counties_corrected, locations='nuts318cd', featureidkey="properties.nuts318cd", color='predictedprevalence',
                            color_continuous_scale="PurPor", labels={'label name':'label name'}, title='MAP TITLE',
                            scope="europe")

fig.update_geos(fitbounds="locations", visible=False)

This is what my dataset (lauth2020.csv) looks like. There are 311 entries:

dataset

I have been a wee stuck for a few days with this and would really appreciate some assistance. Thank you