Update app.py
Browse files
app.py
CHANGED
|
@@ -39,7 +39,13 @@ def analyze_reviews(file_path):
|
|
| 39 |
logger.info("μλ³ λ¦¬λ·° 건μ μ§κ³ μμ")
|
| 40 |
df_recent['λ
μ'] = df_recent['리뷰λ μ§'].dt.to_period('M').astype(str)
|
| 41 |
monthly_review_counts = df_recent.groupby('λ
μ').size().reset_index(name='리뷰건μ')
|
| 42 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
|
| 44 |
# μλ‘μ΄ μνΈμ μ μ₯
|
| 45 |
logger.info("μλ‘μ΄ μνΈμ λ°μ΄ν° μ μ₯ μμ")
|
|
|
|
| 39 |
logger.info("μλ³ λ¦¬λ·° 건μ μ§κ³ μμ")
|
| 40 |
df_recent['λ
μ'] = df_recent['리뷰λ μ§'].dt.to_period('M').astype(str)
|
| 41 |
monthly_review_counts = df_recent.groupby('λ
μ').size().reset_index(name='리뷰건μ')
|
| 42 |
+
|
| 43 |
+
# λλ½λ μ μ±μ°κΈ°
|
| 44 |
+
logger.info("λλ½λ μ μ±μ°κΈ° μμ")
|
| 45 |
+
all_months = pd.period_range(start=f"{start_year}-01", end=f"{current_year}-12", freq='M').astype(str)
|
| 46 |
+
monthly_review_counts = monthly_review_counts.set_index('λ
μ').reindex(all_months, fill_value=0).reset_index()
|
| 47 |
+
monthly_review_counts.columns = ['λ
μ', '리뷰건μ']
|
| 48 |
+
logger.info("λλ½λ μ μ±μ°κΈ° μλ£")
|
| 49 |
|
| 50 |
# μλ‘μ΄ μνΈμ μ μ₯
|
| 51 |
logger.info("μλ‘μ΄ μνΈμ λ°μ΄ν° μ μ₯ μμ")
|