Spaces:
Runtime error
Runtime error
Commit
โข
d91049d
1
Parent(s):
cec6395
Update app.py
Browse files
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 |
-
|
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))
|