tanish78 commited on
Commit
ec40dca
·
verified ·
1 Parent(s): 039b6f3

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -176,15 +176,21 @@ def main(file, num_clusters_to_display):
176
 
177
  # Get the largest x categories as specified by num_clusters_to_display
178
  largest_categories = sorted_categories[:num_clusters_to_display]
 
 
 
 
179
 
180
  # Filter the dataframe to include only the largest categories
181
  filtered_df = df[df['Category'].isin(largest_categories)]
 
 
182
 
183
  # Sort the dataframe by Category
184
  filtered_df = filtered_df.sort_values(by='Category')
185
 
186
  wordcloud_img = generate_wordcloud(filtered_df)
187
- bar_chart_img = generate_bar_chart(filtered_df, num_clusters_to_display)
188
 
189
  with tempfile.NamedTemporaryFile(delete=False, suffix=".csv") as tmpfile:
190
  filtered_df.to_csv(tmpfile.name, index=False)
 
176
 
177
  # Get the largest x categories as specified by num_clusters_to_display
178
  largest_categories = sorted_categories[:num_clusters_to_display]
179
+
180
+
181
+ for i in range(largest_categories.len()):
182
+ print(largest_categories[i] + " " + largest_categories[i].len())
183
 
184
  # Filter the dataframe to include only the largest categories
185
  filtered_df = df[df['Category'].isin(largest_categories)]
186
+
187
+
188
 
189
  # Sort the dataframe by Category
190
  filtered_df = filtered_df.sort_values(by='Category')
191
 
192
  wordcloud_img = generate_wordcloud(filtered_df)
193
+ bar_chart_img = generate_bar_chart(df, num_clusters_to_display)
194
 
195
  with tempfile.NamedTemporaryFile(delete=False, suffix=".csv") as tmpfile:
196
  filtered_df.to_csv(tmpfile.name, index=False)