I am trying to show how much a student has completed from a set of challenges with a plotly sunburst graph. I want to have the ‘category’ maximum value be shown for each of them but only fill in the challenges that they’ve done. I was thinking of having the ones they did not do be greyed out. I have the max values for each of the challenges in the dataframe ‘challenge_count_df’ and the students work in the ‘student_df’:
import pandas as pd
import plotly.express as px
challenge_count_df = pd.DataFrame({'Challenge': ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'],
'Value' : ["5","5","10","15","5","10","5","10","15","10"],
'Category' : ['linux','primer','windows','linux','linux','primer','windows','linux', 'linux', 'primer']})
student_df = pd.DataFrame({'Challenge': ['B', 'C', 'E', 'F', 'G', 'H', 'I'],
'Value' : ["5","10","5","10","5","10","15"],
'Category' : ['primer','windows','linux','primer','windows','linux', 'linux']})
As you can see, the student_df has some of the challenges missing. That’s because they didn’t answer them.
I know how to start a starburst like this:
fig = px.starburst(challenge_count_df, path=['Category','Challenge'],values='Value')
Is there a way to overlap that with this?
fig = px.starburst(student_df, path=['Category','Challenge'],values='Value')