Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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
|
112 |
-
|
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 |
-
|
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,
|