Fred808 commited on
Commit
a5c837e
·
verified ·
1 Parent(s): 5ac8361

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -191,10 +191,10 @@ trending_keywords = Counter(words).most_common(10)
191
  logging.info("Top 10 Trending Keywords in Captions:")
192
  print(trending_keywords)
193
 
194
- # Engagement Heatmap by Time of Day
195
  logging.info("Creating engagement heatmap by time of day...")
196
- engagement_df['hour'] = engagement_df['posting_time'].dt.hour
197
- engagement_by_hour = engagement_df.groupby('hour')['engagement_rate'].mean().reset_index()
198
 
199
  plt.figure(figsize=(10, 6))
200
  sns.heatmap(engagement_by_hour.pivot_table(index='hour', values='engagement_rate'), annot=True, cmap='YlGnBu')
 
191
  logging.info("Top 10 Trending Keywords in Captions:")
192
  print(trending_keywords)
193
 
194
+ # Engagement Heatmap by Time of Day (using combined data)
195
  logging.info("Creating engagement heatmap by time of day...")
196
+ combined_df['hour'] = combined_df['posting_time'].dt.hour
197
+ engagement_by_hour = combined_df.groupby('hour')['engagement_rate'].mean().reset_index()
198
 
199
  plt.figure(figsize=(10, 6))
200
  sns.heatmap(engagement_by_hour.pivot_table(index='hour', values='engagement_rate'), annot=True, cmap='YlGnBu')