panchadip commited on
Commit
fc9f4d7
·
verified ·
1 Parent(s): ea85d87

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -92,11 +92,16 @@ if uploaded_file is not None:
92
  plt.xticks(rotation='vertical')
93
  st.pyplot(fig)
94
 
 
95
  st.title("Weekly Activity Map")
96
  user_heatmap = helper.activity_heatmap(selected_user, df)
97
- fig, ax = plt.subplots()
98
- ax = sns.heatmap(user_heatmap)
99
- st.pyplot(fig)
 
 
 
 
100
 
101
  # Finding the busiest users in the group (Group level)
102
  if selected_user == 'Overall':
 
92
  plt.xticks(rotation='vertical')
93
  st.pyplot(fig)
94
 
95
+ # Weekly Activity Map (Heatmap)
96
  st.title("Weekly Activity Map")
97
  user_heatmap = helper.activity_heatmap(selected_user, df)
98
+
99
+ if not user_heatmap.empty and user_heatmap.notnull().values.any():
100
+ fig, ax = plt.subplots()
101
+ ax = sns.heatmap(user_heatmap)
102
+ st.pyplot(fig)
103
+ else:
104
+ st.write("Insufficient data to generate a heatmap.")
105
 
106
  # Finding the busiest users in the group (Group level)
107
  if selected_user == 'Overall':