leavoigt commited on
Commit
4e33061
1 Parent(s): 7643ffd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +23 -8
app.py CHANGED
@@ -106,9 +106,10 @@ if 'key0' in st.session_state:
106
 
107
  # Assign dataframe a name
108
  df_vul = st.session_state['key0']
109
-
 
110
  col1, col2 = st.columns([1,1])
111
-
112
  with col1:
113
 
114
  # Header
@@ -128,13 +129,27 @@ if 'key0' in st.session_state:
128
  their respective labels in the table below.</div>""", unsafe_allow_html=True)
129
 
130
  with col2:
131
- st.table(df_vul[df_vul['Vulnerability Label'] != 'Other'])
132
- # ### Pie chart
 
133
 
134
- # ## Create a df that stores all the labels
135
- # #df_labels = pd.DataFrame(list(label_dict.items()), columns=['Label ID', 'Label'])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
136
 
137
- # # Count how often each label appears in the "Vulnerability Labels" column
138
  # label_counts = df_vul['Vulnerability Label'].value_counts().reset_index()
139
  # label_counts.columns = ['Label', 'Count']
140
 
@@ -154,7 +169,7 @@ if 'key0' in st.session_state:
154
  # st.plotly_chart(fig, use_container_width=True)
155
 
156
  # ### Table
157
- #st.table(df_vul[df_vul['Vulnerability Label'] != 'Other'])
158
 
159
  # vulnerability_analysis.vulnerability_display()
160
  # elif topic == 'Action':
 
106
 
107
  # Assign dataframe a name
108
  df_vul = st.session_state['key0']
109
+ st.write(df_vul)
110
+
111
  col1, col2 = st.columns([1,1])
112
+
113
  with col1:
114
 
115
  # Header
 
129
  their respective labels in the table below.</div>""", unsafe_allow_html=True)
130
 
131
  with col2:
132
+
133
+
134
+ # ### Pie chart
135
 
136
+ # # Create a df that stores all the labels
137
+ # df_labels = pd.DataFrame(list(label_dict.items()), columns=['Label ID', 'Label'])
138
+
139
+ # # Count how often each label appears in the "Vulnerability Labels" column
140
+ # group_counts = {}
141
+
142
+ # # Iterate through each sublist
143
+ # for index, row in df_vul:
144
+
145
+ # # Iterate through each group in the sublist
146
+ # for group in row['Vulnerability Label']:
147
+
148
+ # # Update the count in the dictionary
149
+ # group_counts[group] = group_counts.get(group, 0) + 1
150
+
151
+ # st.write(group_counts)
152
 
 
153
  # label_counts = df_vul['Vulnerability Label'].value_counts().reset_index()
154
  # label_counts.columns = ['Label', 'Count']
155
 
 
169
  # st.plotly_chart(fig, use_container_width=True)
170
 
171
  # ### Table
172
+ st.table(df_vul[df_vul['Vulnerability Label'] != 'Other'])
173
 
174
  # vulnerability_analysis.vulnerability_display()
175
  # elif topic == 'Action':