Spaces:
Runtime error
Runtime error
Commit
โข
5df90c0
1
Parent(s):
cc8d643
Upload 13 files
Browse files- .gitattributes +1 -0
- app(1).py +96 -0
- final_NETWORK.png +0 -0
- final_WORDCLOUD.png +0 -0
- final_image_1.jpg +0 -0
- final_image_2.jpg +0 -0
- final_image_3.jpg +0 -0
- final_image_4.jpg +0 -0
- final_image_5.jpg +0 -0
- final_image_6.jpg +3 -0
- pre_keywords.xlsx +0 -0
- vietnam_food_KEYWORDS.xlsx +0 -0
- vietnam_food_blog_NOUNS.xlsx +0 -0
- vietnam_food_dongdaemun_BLOGS.xlsx +0 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
final_image_6.jpg filter=lfs diff=lfs merge=lfs -text
|
app(1).py
ADDED
@@ -0,0 +1,96 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
import pandas as pd
|
3 |
+
import matplotlib.pyplot as plt
|
4 |
+
import pandas_bokeh
|
5 |
+
|
6 |
+
|
7 |
+
# ๊ธ ์ฐ๊ธฐ(๋งํฌ ์ฝ์
)
|
8 |
+
st.title('VIETNAM DONGDAEMUN FOOOOOOOOOD!!!!!!!!!')
|
9 |
+
|
10 |
+
st.header('Selection of Vietnamese Restaurants in Dongdaemun Area')
|
11 |
+
st.subheader('Variety of dishes from different region in Vietnam, made affordable and delicious for local taste')
|
12 |
+
st.subheader('Items such as Pho Soup, Bun Bo Hue, Cha Gio or Com Chien')
|
13 |
+
st.write('''Write something here about the booming of Vietnamese Restaurant in Korea - particularly the fast growing food scene in Dongdaemun [ํธ๋ํธ๋ญ](https://namu.wiki/w/%EB%B2%A0%ED%8A%B8%EB%82%A8%20%EC%9A%94%EB%A6%AC)
|
14 |
+
.''' )
|
15 |
+
|
16 |
+
# ์ฌ์ง ์ฝ์
|
17 |
+
st.image('/content/drive/MyDrive/DATA JOURNALISM/final - may31/final_image_2.jpg', caption='A Spread of Vietnamese Dishes You Might Be Able To Find')
|
18 |
+
|
19 |
+
st.image('/content/drive/MyDrive/DATA JOURNALISM/final - may31/final_image_4.jpg', caption='A popular choice everywhere: Vietnamese Pho Soup')
|
20 |
+
|
21 |
+
st.image('/content/drive/MyDrive/DATA JOURNALISM/final - may31/final_image_3.jpg', caption='Hidden Gem: Banh Xeo')
|
22 |
+
|
23 |
+
|
24 |
+
st.header('Cheap and Delicious: One can find a variety of Vietnamese Restaurant in Dongdaemun Area')
|
25 |
+
st.subheader('Hosting dishes from North to South Vietnam')
|
26 |
+
st.subheader('The almost infinite choices will leave you looking for reviews!')
|
27 |
+
st.write('''Before deciding on which dish you'd want ~ carefully browse through the Blog section for an intimate look at the local food joints''' )
|
28 |
+
|
29 |
+
# ๋ฐ์ดํฐ ๋ณด์ฌ์ฃผ๊ธฐ
|
30 |
+
df_แแ
งแผแแ
ดแแ
ขแแ
กแบแแ
ตแธ = pd.read_excel('/content/drive/MyDrive/DATA JOURNALISM/final - may31/vietnam_food_dongdaemun_BLOGS.xlsx', index_col=0)
|
31 |
+
st.write('We have narrowed down to 150 most relevant blogs!!', df_แแ
งแผแแ
ดแแ
ขแแ
กแบแแ
ตแธ)
|
32 |
+
|
33 |
+
df_แแ
งแผแแ
ดแแ
ขแแ
กแบแแ
ตแธ_keyword = pd.read_excel('/content/drive/MyDrive/DATA JOURNALISM/final - may31/vietnam_food_KEYWORDS.xlsx', index_col=0)
|
34 |
+
st.write('๋ธ๋ก๊ทธ ๊ธ์์ ๊ฐ์ฅ ๋ง์ด ์ถํํ ๋จ์ด๋ ~~~ ์ค๋ช
~~~', df_แแ
งแผแแ
ดแแ
ขแแ
กแบแแ
ตแธ_keyword)
|
35 |
+
|
36 |
+
|
37 |
+
|
38 |
+
# ์๋ํด๋ผ์ฐ๋ - WORDCLOUD
|
39 |
+
st.write('์ฃผ์ ๋จ์ด๋ค์ ์๋ํด๋ผ์ฐ๋๋ก ๋ณด์ฌ์ฃผ๋ฉด ๋ค์๊ณผ ๊ฐ๋ค')
|
40 |
+
st.image('/content/drive/MyDrive/DATA JOURNALISM/final - may31/final_WORDCLOUD.png')
|
41 |
+
|
42 |
+
|
43 |
+
|
44 |
+
# ์ฐ๊ฒฐ๋ง ๋ถ์ - NETWORK
|
45 |
+
st.write('''์ทจ์ฌํ์ ์ฃผ์ ๋จ์ด๋ค ๊ฐ์ ๊ณต๋์ถํํ๋ ๊ด๊ณ๋ฅผ ๋ฐํ์ผ๋ก ์๋ฏธ์ฐ๊ฒฐ๋ง์ ๊ทธ๋ ค๋ณด์๋ค.
|
46 |
+
๋ถ์๊ฒฐ๊ณผ, ~~์ค๋ช
~~''')
|
47 |
+
st.image('/content/drive/MyDrive/DATA JOURNALISM/final - may31/final_NETWORK.png')
|
48 |
+
|
49 |
+
#### The Section Below Is Extra Stuff We Gotta Think About
|
50 |
+
'''
|
51 |
+
#
|
52 |
+
df_๊ตํต์ฌ๊ณ = pd.read_excel('/content/drive/MyDrive/2024_1_class/data_jour/data_traffic_accidents.xlsx', index_col=0)
|
53 |
+
st.write('๋ค์ ๋ฐ์ดํฐ๋ ์ ๊ตญ์ ๊ตํต์ฌ๊ณ ๋ฅผ ์ง์ญ๋ณ๋ก ์ง๊ณํ ๊ฒ์ด๋ค', df_๊ตํต์ฌ๊ณ )
|
54 |
+
|
55 |
+
# ๊ฒ์์ด ์
๋ ฅ ๋ฐ์ ์ถ๋ ฅ
|
56 |
+
query = st.text_input('์ด ๊ณณ์ ์ง์ญ๋ช
(์๊ตฐ๊ตฌ๋์๋ฉด)์ ์
๋ ฅํ๋ฉด ๊ด๋ จ ๋ฐ์ดํฐ๋ง ๊ฒ์ํด ๋ณด์ฌ์ค๋๋ค', key='region1_input')
|
57 |
+
df_๊ตํต์ฌ๊ณ ['select1']=df_๊ตํต์ฌ๊ณ ['์ฌ๊ณ ์ง์ญ์์น๋ช
'].apply(lambda x: 1 if query in x else 0)
|
58 |
+
st.write('๊ฒ์ ๊ฒฐ๊ณผ:', df_๊ตํต์ฌ๊ณ [df_๊ตํต์ฌ๊ณ ['select1']==1])
|
59 |
+
|
60 |
+
# ๊ตํต์ฌ๊ณ ์ ํ๊ณผ ์ฐ๋์ ๋ฐ๋ฅธ pivot table ๋ณด์ฌ์ฃผ๊ธฐ
|
61 |
+
df_๊ตํต์ฌ๊ณ _pivot=df_๊ตํต์ฌ๊ณ .pivot_table(index='์ฌ๊ณ ์ ํ๊ตฌ๋ถ', columns='์ฌ๊ณ ์ฐ๋', values='์ฌ๊ณ ๊ฑด์', aggfunc='sum')
|
62 |
+
df_๊ตํต์ฌ๊ณ _heatmap=df_๊ตํต์ฌ๊ณ _pivot.style.background_gradient(cmap='Oranges').format("{:.2f}")
|
63 |
+
st.write('๋ค์ ํ๋ ๊ตํต์ฌ๊ณ ๊ฑด์๋ฅผ ์ ํ๊ณผ ์ฐ๋์ ๋ฐ๋ผ ๊ตฌ๋ถํ ๊ฒ์ด๋ค', df_๊ตํต์ฌ๊ณ _heatmap)
|
64 |
+
|
65 |
+
# ๊ฒ์์ด ์
๋ ฅ ๋ฐ์ pivot table ์ถ๋ ฅ
|
66 |
+
query_pivot = st.text_input('์ด ๊ณณ์ ์ง์ญ๋ช
(์๊ตฐ๊ตฌ)์ ์
๋ ฅํ๋ฉด ๊ด๋ จ ๋ฐ์ดํฐ๋ง ๊ฒ์ํด ๋ณด์ฌ์ค๋๋ค', key='region2_input')
|
67 |
+
df_๊ตํต์ฌ๊ณ ['select2']=df_๊ตํต์ฌ๊ณ ['์ฌ๊ณ ์ง์ญ์์น๋ช
'].apply(lambda x: 1 if query_pivot in x else 0)
|
68 |
+
df_๊ตํต์ฌ๊ณ _pivot_selected=df_๊ตํต์ฌ๊ณ [df_๊ตํต์ฌ๊ณ ['select2']==1].pivot_table(index='์ฌ๊ณ ์ ํ๊ตฌ๋ถ', columns='์ฌ๊ณ ์ฐ๋', values='์ฌ๊ณ ๊ฑด์', aggfunc='sum')
|
69 |
+
df_๊ตํต์ฌ๊ณ _heatmap_selected=df_๊ตํต์ฌ๊ณ _pivot_selected.style.background_gradient(cmap='Oranges').format("{:.2f}")
|
70 |
+
st.write('๊ฒ์ ๊ฒฐ๊ณผ:', df_๊ตํต์ฌ๊ณ _heatmap_selected)
|
71 |
+
|
72 |
+
# pandas_bokeh ๊ทธ๋ํ ๋ณด์ฌ์ฃผ๊ธฐ
|
73 |
+
st.write('์ ๊ตญ ๊ตํต์ฌ๊ณ ๋ฐ์ดํฐ์ ๋ฐ๋ฅด๋ฉด, ์ฌ๊ณ ๊ฑด์์ ์ค์์์๋ ๋ฐ์ ํ ๊ด๋ จ์ ๋งบ๊ณ ์๋ค. ~~~์ค๋ช
~~. *๊ทธ๋ํ ๋ด ์ ์ ์ปค์๋ฅผ ๋๋ฉด ์ง์ญ๋ช
์ด ๋ํ๋๋ค')
|
74 |
+
p_scatter = df_๊ตํต์ฌ๊ณ .plot_bokeh.scatter(
|
75 |
+
x="์ฌ๊ณ ๊ฑด์",
|
76 |
+
y="์ค์์์",
|
77 |
+
title="์ฌ๊ณ ๊ฑด์์ ์ค์์์",
|
78 |
+
size=10,
|
79 |
+
hovertool_string="""<h6>์์น:@{์ฌ๊ณ ์ง์ญ์์น๋ช
}</h6>"""
|
80 |
+
)
|
81 |
+
st.bokeh_chart(p_scatter, use_container_width=True)
|
82 |
+
|
83 |
+
# ์ ํํ ์กฐ๊ฑด์ ๋ฐ๋ผ ์ถ๋ ฅ
|
84 |
+
option = st.selectbox('์ฐ๋๋ฅผ ์ ํํ๋ฉด ํด๋น ์๊ธฐ์ ๊ทธ๋ํ๋ฅผ ๋ณด์ฌ์ค๋๋ค',
|
85 |
+
(2012, 2013, 2014, 2015, 2016, 2018, 2017, 2019, 2020, 2021), key='year_input')
|
86 |
+
|
87 |
+
p_scatter_selected = df_๊ตํต์ฌ๊ณ [df_๊ตํต์ฌ๊ณ ['์ฌ๊ณ ์ฐ๋']==option].plot_bokeh.scatter(
|
88 |
+
x="์ฌ๊ณ ๊ฑด์",
|
89 |
+
y="์ค์์์",
|
90 |
+
title="์ฌ๊ณ ๊ฑด์์ ์ค์์์",
|
91 |
+
size=10,
|
92 |
+
hovertool_string="""<h6>์์น:@{์ฌ๊ณ ์ง์ญ์์น๋ช
}</h6>"""
|
93 |
+
)
|
94 |
+
st.write('๊ฒ์ ๊ฒฐ๊ณผ:')
|
95 |
+
st.bokeh_chart(p_scatter_selected, use_container_width=True)
|
96 |
+
'''
|
final_NETWORK.png
ADDED
![]() |
final_WORDCLOUD.png
ADDED
![]() |
final_image_1.jpg
ADDED
![]() |
final_image_2.jpg
ADDED
![]() |
final_image_3.jpg
ADDED
![]() |
final_image_4.jpg
ADDED
![]() |
final_image_5.jpg
ADDED
![]() |
final_image_6.jpg
ADDED
![]() |
Git LFS Details
|
pre_keywords.xlsx
ADDED
Binary file (34.9 kB). View file
|
|
vietnam_food_KEYWORDS.xlsx
ADDED
Binary file (10.9 kB). View file
|
|
vietnam_food_blog_NOUNS.xlsx
ADDED
Binary file (60.4 kB). View file
|
|
vietnam_food_dongdaemun_BLOGS.xlsx
ADDED
Binary file (28.7 kB). View file
|
|