Spaces:
GIZ
/
Running on CPU Upgrade

leavoigt commited on
Commit
4393f89
1 Parent(s): 42d7457

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -108,15 +108,15 @@ if 'key0' in st.session_state:
108
  # Pie chart
109
  with col1:
110
 
111
- # Create a df that stores how often the labels appear
112
- df_count = pd.DataFrame(list(label_dict.items()), columns=['Label ID', 'Label'])
113
 
114
  # Count how often each label appears in the "Vulnerability Labels" column
115
  label_counts = st.session_state['key0']['Vulnerability Label'].value_counts().reset_index()
116
  label_counts.columns = ['Label', 'Count']
117
 
118
  # Merge the label counts with the df_label DataFrame
119
- df_label = df_label.merge(label_counts, on='Label', how='left')
120
 
121
 
122
  fig = px.bar(df_label,
 
108
  # Pie chart
109
  with col1:
110
 
111
+ # Create a df that stores all the labels
112
+ df_labels = pd.DataFrame(list(label_dict.items()), columns=['Label ID', 'Label'])
113
 
114
  # Count how often each label appears in the "Vulnerability Labels" column
115
  label_counts = st.session_state['key0']['Vulnerability Label'].value_counts().reset_index()
116
  label_counts.columns = ['Label', 'Count']
117
 
118
  # Merge the label counts with the df_label DataFrame
119
+ df_labels = df_labels.merge(label_counts, on='Label', how='left')
120
 
121
 
122
  fig = px.bar(df_label,