myquyen242 commited on
Commit
d91049d
โ€ข
1 Parent(s): cec6395

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -60,7 +60,6 @@ st.image('final_NETWORK.png')
60
 
61
  #
62
  df_๋™๋Œ€๋ฌธ๊ตฌ_๋ฒ ํŠธ๋‚จ_๋ง›์ง‘_2 = pd.read_excel('vietnam_food_dongdaemun_BLOGS.xlsx', index_col=0)
63
- #st.write('Again, the list of blog posts on Dongdaemun Vietnamese Restaurant', df_๋™๋Œ€๋ฌธ๊ตฌ_๋ฒ ํŠธ๋‚จ_๋ง›์ง‘_2)
64
 
65
  # ๊ฒ€์ƒ‰์–ด ์ž…๋ ฅ ๋ฐ›์•„ ์ถœ๋ ฅ
66
  query = st.text_input('์Œ์‹ ์ด๋ฆ„, ์‹๋‹น ์ด๋ฆ„ ๋“ฑ์˜ ๊ฒ€์ƒ‰์–ด๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”.', key='region1_input')
@@ -88,13 +87,12 @@ st.title('ํ•œ๊ตญ ๋‚ด "๋ฒ ํŠธ๋‚จ ์Œ์‹" ์›”๋ณ„ ํŠธ๋ Œ๋“œ ๋ฐ์ดํ„ฐ (2022๋…„ vs 2
88
  def process_and_display_data(df, source_name):
89
  if not df.empty:
90
  if 'Date' in df.columns:
91
- # For Naver data, pivot the table
92
  df['Date'] = pd.to_datetime(df['Date'])
93
  df['Month'] = df['Date'].dt.month
94
  df['Year'] = df['Date'].dt.year
95
  df = df.pivot(index='Year', columns='Month', values='Value')
96
 
97
- # Ensure that index is properly set as integer for years
98
  df.index = df.index.astype(int)
99
 
100
  # Convert month numbers to month names
@@ -109,7 +107,7 @@ def process_and_display_data(df, source_name):
109
 
110
  st.write(f'Number of searches for each month ({source_name}):')
111
 
112
- # Create a seaborn heatmap for better visualization
113
  plt.figure(figsize=(12, 4))
114
  sns.heatmap(df, annot=True, fmt=".1f", cmap="Oranges", linewidths=.5, cbar_kws={'label': 'Number of Searches'})
115
  plt.title(f'Monthly {source_name} Trends Data for ๋ฒ ํŠธ๋‚จ ์Œ์‹ in South Korea (2022 vs 2023)', fontsize=22, fontproperties=fm.FontProperties(fname=font_path))
 
60
 
61
  #
62
  df_๋™๋Œ€๋ฌธ๊ตฌ_๋ฒ ํŠธ๋‚จ_๋ง›์ง‘_2 = pd.read_excel('vietnam_food_dongdaemun_BLOGS.xlsx', index_col=0)
 
63
 
64
  # ๊ฒ€์ƒ‰์–ด ์ž…๋ ฅ ๋ฐ›์•„ ์ถœ๋ ฅ
65
  query = st.text_input('์Œ์‹ ์ด๋ฆ„, ์‹๋‹น ์ด๋ฆ„ ๋“ฑ์˜ ๊ฒ€์ƒ‰์–ด๋ฅผ ์ž…๋ ฅํ•˜์„ธ์š”.', key='region1_input')
 
87
  def process_and_display_data(df, source_name):
88
  if not df.empty:
89
  if 'Date' in df.columns:
90
+
91
  df['Date'] = pd.to_datetime(df['Date'])
92
  df['Month'] = df['Date'].dt.month
93
  df['Year'] = df['Date'].dt.year
94
  df = df.pivot(index='Year', columns='Month', values='Value')
95
 
 
96
  df.index = df.index.astype(int)
97
 
98
  # Convert month numbers to month names
 
107
 
108
  st.write(f'Number of searches for each month ({source_name}):')
109
 
110
+ # Create a seaborn heatmap for better visualization since matplot gradient wasn't working
111
  plt.figure(figsize=(12, 4))
112
  sns.heatmap(df, annot=True, fmt=".1f", cmap="Oranges", linewidths=.5, cbar_kws={'label': 'Number of Searches'})
113
  plt.title(f'Monthly {source_name} Trends Data for ๋ฒ ํŠธ๋‚จ ์Œ์‹ in South Korea (2022 vs 2023)', fontsize=22, fontproperties=fm.FontProperties(fname=font_path))