naufalnashif
commited on
Commit
·
1b9500e
1
Parent(s):
90c6af4
Update app.py
Browse files
app.py
CHANGED
@@ -251,14 +251,14 @@ with st.expander("General Settings :"):
|
|
251 |
|
252 |
if 'Text' not in df.columns:
|
253 |
st.warning("Berkas XLSX harus memiliki kolom bernama 'Text' untuk analisis sentimen.")
|
254 |
-
if df['Text']
|
255 |
st.warning("Kolom 'Text' harus mempunyai value.")
|
256 |
else:
|
257 |
texts = df['Text'] # Sesuaikan dengan nama kolom di berkas XLSX Anda
|
258 |
if "Date" in df.columns :
|
259 |
-
if df['Date']
|
260 |
dates = df['Date']
|
261 |
-
target_year = st.selectbox("Pilih Tahun Bar Chart :",
|
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"])
|
@@ -343,7 +343,7 @@ if results and analisis == True:
|
|
343 |
st.write("Tidak ada data untuk ditampilkan dalam Word Cloud.")
|
344 |
|
345 |
if 'Date' in df_results.columns:
|
346 |
-
if df_results['Date']
|
347 |
with columns[1]:
|
348 |
buat_chart(df_results, target_year)
|
349 |
else :
|
|
|
251 |
|
252 |
if 'Text' not in df.columns:
|
253 |
st.warning("Berkas XLSX harus memiliki kolom bernama 'Text' untuk analisis sentimen.")
|
254 |
+
if not df['Text'].empty:
|
255 |
st.warning("Kolom 'Text' harus mempunyai value.")
|
256 |
else:
|
257 |
texts = df['Text'] # Sesuaikan dengan nama kolom di berkas XLSX Anda
|
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"])
|
|
|
343 |
st.write("Tidak ada data untuk ditampilkan dalam Word Cloud.")
|
344 |
|
345 |
if 'Date' in df_results.columns:
|
346 |
+
if not df_results['Date'].empty:
|
347 |
with columns[1]:
|
348 |
buat_chart(df_results, target_year)
|
349 |
else :
|