dltmdgus commited on
Commit
bd3e270
ยท
verified ยท
1 Parent(s): 713d6ee

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -13
app.py CHANGED
@@ -88,17 +88,8 @@ elif page == "์—ฐ๋ น๋Œ€ ๋ฐ ์„ฑ๋ณ„์— ๋”ฐ๋ฅธ ์ƒ์œ„ 3๊ฐœ ์žฅ๋ฅด":
88
  st.write(f"{selected_age} - {selected_gender}์— ๋”ฐ๋ฅธ ์ฃผ์ œ ๋ถ„๋ฅ˜๋ช…:")
89
  st.write(genre_list)
90
 
91
- # ์ „์ฒด ๋ฐ์ดํ„ฐ๋ฅผ ๊ธฐ์ค€์œผ๋กœ ์žฅ๋ฅด๋ณ„ ๋Œ€์ถœ ๊ฑด์ˆ˜ ์ง‘๊ณ„
92
- genre_counts = df.groupby('์ฃผ์ œ๋ถ„๋ฅ˜๋ช…')['๋Œ€์ถœ๊ฑด์ˆ˜'].sum().reset_index()
93
-
94
- # ํžˆํŠธ๋งต ์‹œ๊ฐํ™”์šฉ ๋ฐ์ดํ„ฐํ”„๋ ˆ์ž„ ์ƒ์„ฑ
95
- df_pivot = genre_counts.pivot_table(index='์ฃผ์ œ๋ถ„๋ฅ˜๋ช…', values='๋Œ€์ถœ๊ฑด์ˆ˜', aggfunc='sum')
96
 
97
- # ํžˆํŠธ๋งต ์‹œ๊ฐํ™”
98
- fig, ax = plt.subplots(figsize=(14, 10))
99
- sns.heatmap(df_pivot, annot=True, cmap='YlGnBu', cbar=True, ax=ax)
100
- ax.set_title('์ „์ฒด ์—ฐ๋ น๋Œ€ ๋ฐ ์„ฑ๋ณ„๋ณ„ ์žฅ๋ฅด๋ณ„ ๋Œ€์ถœ ๊ฑด์ˆ˜ ํžˆํŠธ๋งต')
101
- ax.set_xlabel('๋Œ€์ถœ๊ฑด์ˆ˜')
102
- ax.set_ylabel('์žฅ๋ฅด')
103
- plt.xticks(rotation=90)
104
- st.pyplot(fig)
 
88
  st.write(f"{selected_age} - {selected_gender}์— ๋”ฐ๋ฅธ ์ฃผ์ œ ๋ถ„๋ฅ˜๋ช…:")
89
  st.write(genre_list)
90
 
91
+ # ์ด๋ฏธ์ง€ ํŒŒ์ผ ๊ฒฝ๋กœ
92
+ image_path = r'heat_map.pdf'
 
 
 
93
 
94
+ # ์ด๋ฏธ์ง€ ์—…๋กœ๋“œ ๋ฐ ํ‘œ์‹œ
95
+ st.image(image_path, caption="ํžˆํŠธ๋งต", use_column_width=True)