Commit
·
8545923
1
Parent(s):
7dd618f
Update app.py
Browse files
app.py
CHANGED
@@ -258,10 +258,13 @@ with st.expander("General Settings :"):
|
|
258 |
if "Date" in df.columns :
|
259 |
if not df['Date'].empty:
|
260 |
dates = df['Date']
|
|
|
261 |
target_year = st.selectbox("Pilih Tahun Bar Chart :", df['Date'].str[:4].unique())
|
|
|
262 |
#-----------------------------------------------------Preference Settings--------------------------------------------------
|
263 |
with st.expander ("Preference Settings :"):
|
264 |
colormap = st.selectbox("Pilih Warna Wordclouds :", ["Greys", "Purples", "Blues", "Greens", "Oranges", "Reds", "YlOrBr", "YlOrRd", "OrRd", "PuRd", "RdPu", "BuPu", "GnBu", "PuBu", "YlGnBu", "PuBuGn", "BuGn", "YlGn"])
|
|
|
265 |
# Analisis sentimen
|
266 |
results = []
|
267 |
analisis = False
|
@@ -356,9 +359,18 @@ if results and analisis == True:
|
|
356 |
st.write("Tidak ada data untuk ditampilkan dalam Word Cloud.")
|
357 |
|
358 |
if 'Date' in df_results.columns:
|
359 |
-
if
|
|
|
|
|
|
|
|
|
|
|
360 |
with columns[1]:
|
361 |
-
|
|
|
|
|
|
|
|
|
362 |
else :
|
363 |
# Kolom kedua untuk Bar Chart
|
364 |
with columns[1]:
|
|
|
258 |
if "Date" in df.columns :
|
259 |
if not df['Date'].empty:
|
260 |
dates = df['Date']
|
261 |
+
bar = st.selectbox("Pilih Tampilan Bar Chart :", ("Distribusi Kelas", "Distribusi Kelas Berdasarkan Waktu"), index = 0)
|
262 |
target_year = st.selectbox("Pilih Tahun Bar Chart :", df['Date'].str[:4].unique())
|
263 |
+
|
264 |
#-----------------------------------------------------Preference Settings--------------------------------------------------
|
265 |
with st.expander ("Preference Settings :"):
|
266 |
colormap = st.selectbox("Pilih Warna Wordclouds :", ["Greys", "Purples", "Blues", "Greens", "Oranges", "Reds", "YlOrBr", "YlOrRd", "OrRd", "PuRd", "RdPu", "BuPu", "GnBu", "PuBu", "YlGnBu", "PuBuGn", "BuGn", "YlGn"])
|
267 |
+
|
268 |
# Analisis sentimen
|
269 |
results = []
|
270 |
analisis = False
|
|
|
359 |
st.write("Tidak ada data untuk ditampilkan dalam Word Cloud.")
|
360 |
|
361 |
if 'Date' in df_results.columns:
|
362 |
+
if bar == "Distribusi Kelas Berdasarkan Waktu":
|
363 |
+
if not df_results['Date'].empty:
|
364 |
+
with columns[1]:
|
365 |
+
buat_chart(df_results, target_year)
|
366 |
+
else :
|
367 |
+
# Kolom kedua untuk Bar Chart
|
368 |
with columns[1]:
|
369 |
+
st.write("Bar Chart :")
|
370 |
+
# Membuat bar chart
|
371 |
+
st.bar_chart(
|
372 |
+
df_results["label"].value_counts()
|
373 |
+
)
|
374 |
else :
|
375 |
# Kolom kedua untuk Bar Chart
|
376 |
with columns[1]:
|