I have a data structure that is a nested dictionary called team_dict. Team_dict looks like this: team_dict[teams][players][stats]
.
Team_dict = {'gs': {'Steph': {'PPG':26 ,'Reb':10 'Ast':10} }}
The problem I am having is that I can plot all of my data fine but i want to get the markers to be the same color for each team. I know that the reason is because i is iterated over the loop for each player. Right now my code for the scatter plot is:
'data': [
go.Scatter(
x=[team_dict[i][p]['Salary']],
y=[team_dict[i][p]['PPG']],
text=p,
mode='markers',
opacity=0.7,
marker={
'size': 15,
'line': {'width': .5, 'color': 'black'}
},
name= i,
)
for i in team_initials
for p in team_dict[i]
],
Here is an image of how it looks like now: scatterplot so far I have tried looking at the dash documentation and other methods but nothing seems to work. Am I not supposed to use nested dictionaries to plot dash graphs?