Update app.py
Browse files
app.py
CHANGED
@@ -232,13 +232,15 @@ choices.insert(0,'None')
|
|
232 |
# st.write(f"NPR articles: {st.session_state['npr']}")
|
233 |
# st.write(f"Number of clusters {st.session_state['num_clusters']}")
|
234 |
|
|
|
235 |
# Display topics to user currently in sidebar - april 15 2022
|
236 |
st.sidebar.subheader("Topics")
|
237 |
show_clusters = {i:len(clusters[i]) for i in clusters.keys()}
|
238 |
-
cdf = pd.DataFrame(data={"Cluster":list(show_clusters.keys()), "Articles":list(show_clusters.values())} )
|
239 |
styler = cdf.style.hide_index()
|
240 |
st.sidebar.write(styler.to_html(), unsafe_allow_html=True)
|
241 |
|
|
|
242 |
# Get session time
|
243 |
st.session_state['dt'] = dt.now()
|
244 |
# Form used to take 3 menu inputs
|
|
|
232 |
# st.write(f"NPR articles: {st.session_state['npr']}")
|
233 |
# st.write(f"Number of clusters {st.session_state['num_clusters']}")
|
234 |
|
235 |
+
|
236 |
# Display topics to user currently in sidebar - april 15 2022
|
237 |
st.sidebar.subheader("Topics")
|
238 |
show_clusters = {i:len(clusters[i]) for i in clusters.keys()}
|
239 |
+
cdf = pd.DataFrame(data={"Cluster":list(show_clusters.keys()), "Articles":list(show_clusters.values())} ).sort_values(by='Articles', ascending=False)
|
240 |
styler = cdf.style.hide_index()
|
241 |
st.sidebar.write(styler.to_html(), unsafe_allow_html=True)
|
242 |
|
243 |
+
|
244 |
# Get session time
|
245 |
st.session_state['dt'] = dt.now()
|
246 |
# Form used to take 3 menu inputs
|