current code: https://bpa.st/LFKWW
Hi all,
I am very new to this, hoping to get a dash expert that would be able to help me here. I have this code that currently shows scores of all people however, I was to now add another spreadsheet that puts these score into groups via another spreadsheet. Here is my code currenlty:
import plotly.express as px
import pandas as pd
df = pd.read_csv("DATA.csv")
import dash_html_components as html
import dash_core_components as dcc
from dash.dependencies import Output, Input
app = dash.Dash(__name__)
app.layout = html.Div([
html.H1("Graph Analysis of SCORE Data"),
dcc.Dropdown(id='choice',
options=[{'label':x, 'value':x}
for x in sorted(df.SCORE.unique())],
value='Username'
),
dcc.Graph(id='my-graph', figure=px.histogram(data_frame=df, y='SCORE', x='Username') or {})
])
@app.callback(
Output(component_id='my-graph', component_property='figure'),
Input(component_id='choice', component_property='value')
)
def interactive_graphing(value_choice):
print(value_choice)
dff = df[df.SCORE==value_choice] #only there rows appear not the whiole dataframe
figure= px.bar(data_frame=dff, x='SCORE', y='Username')
return figure
if __name__ =='__main__':
app.run_server()
I wish to add another spreadsheet file, match the USERNAME on both spreadsheets and display the Class in the dropdown and then Usernames in that class with the score my other spreadsheet it is shown like so (no headers):
Username1 class1 class2 class3
Username2 class3 class4 class1
I need some help, can anyone assist me with this please, very new to dash, trying to learn by following charmingdata’s youtube videos, just stuck with this atm.