naufalnashif
commited on
Commit
•
5d34b59
1
Parent(s):
acc6788
Update app.py
Browse files
app.py
CHANGED
@@ -250,13 +250,14 @@ with st.expander("General Settings :"):
|
|
250 |
|
251 |
if 'Text' not in df.columns:
|
252 |
st.warning("Berkas XLSX harus memiliki kolom bernama 'Text' untuk analisis sentimen.")
|
253 |
-
|
254 |
-
|
255 |
else:
|
256 |
texts = df['Text'] # Sesuaikan dengan nama kolom di berkas XLSX Anda
|
257 |
-
if
|
258 |
-
|
259 |
-
|
|
|
260 |
#-----------------------------------------------------Preference Settings--------------------------------------------------
|
261 |
with st.expander ("Preference Settings :"):
|
262 |
colormap = st.selectbox("Pilih Warna Wordclouds :", ["Greys", "Purples", "Blues", "Greens", "Oranges", "Reds", "YlOrBr", "YlOrRd", "OrRd", "PuRd", "RdPu", "BuPu", "GnBu", "PuBu", "YlGnBu", "PuBuGn", "BuGn", "YlGn"])
|
@@ -339,9 +340,10 @@ if results and analisis == True:
|
|
339 |
else:
|
340 |
st.write("Tidak ada data untuk ditampilkan dalam Word Cloud.")
|
341 |
|
342 |
-
if
|
343 |
-
|
344 |
-
|
|
|
345 |
else :
|
346 |
# Kolom kedua untuk Bar Chart
|
347 |
with columns[1]:
|
|
|
250 |
|
251 |
if 'Text' not in df.columns:
|
252 |
st.warning("Berkas XLSX harus memiliki kolom bernama 'Text' untuk analisis sentimen.")
|
253 |
+
if df['Text'] is None :
|
254 |
+
st.warning("Kolom 'Text' harus mempunyai value.")
|
255 |
else:
|
256 |
texts = df['Text'] # Sesuaikan dengan nama kolom di berkas XLSX Anda
|
257 |
+
if "Date" in df.columns :
|
258 |
+
if df['Date'] is not None :
|
259 |
+
dates = df['Date']
|
260 |
+
target_year = st.selectbox("Pilih Tahun Bar Chart :", dates.unique())
|
261 |
#-----------------------------------------------------Preference Settings--------------------------------------------------
|
262 |
with st.expander ("Preference Settings :"):
|
263 |
colormap = st.selectbox("Pilih Warna Wordclouds :", ["Greys", "Purples", "Blues", "Greens", "Oranges", "Reds", "YlOrBr", "YlOrRd", "OrRd", "PuRd", "RdPu", "BuPu", "GnBu", "PuBu", "YlGnBu", "PuBuGn", "BuGn", "YlGn"])
|
|
|
340 |
else:
|
341 |
st.write("Tidak ada data untuk ditampilkan dalam Word Cloud.")
|
342 |
|
343 |
+
if 'Date' in df_results.columns:
|
344 |
+
if df_results['Date'] is not None:
|
345 |
+
with columns[1]:
|
346 |
+
buat_chart(df_results, target_year)
|
347 |
else :
|
348 |
# Kolom kedua untuk Bar Chart
|
349 |
with columns[1]:
|