Penguni commited on
Commit
ac93622
·
verified ·
1 Parent(s): 2bd7c48

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -10
app.py CHANGED
@@ -124,16 +124,8 @@ def create_genre_wordcloud(conn):
124
  genres = df['genres'].str.split(',', expand=True).stack().replace('\\N', pd.NA).dropna().reset_index(drop=True)
125
  genre_counts = Counter(genres)
126
 
127
- # Create a circular mask
128
- mask = np.zeros((800, 800), dtype=np.uint8)
129
- center_x, center_y = 400, 400
130
- radius = 400
131
- y, x = np.ogrid[:800, :800]
132
- mask_area = (x - center_x)**2 + (y - center_y)**2 <= radius**2
133
- mask[mask_area] = 255
134
-
135
- # Generate the word cloud with the circular mask and custom colors
136
- wordcloud = WordCloud(width=800, height=800, background_color='white', mask=mask, color_func=genre_color_func).generate_from_frequencies(genre_counts)
137
 
138
  # Display the word cloud
139
  plt.figure(figsize=(10, 10))
 
124
  genres = df['genres'].str.split(',', expand=True).stack().replace('\\N', pd.NA).dropna().reset_index(drop=True)
125
  genre_counts = Counter(genres)
126
 
127
+ # Generate the word cloud with custom colors
128
+ wordcloud = WordCloud(width=800, height=800, background_color='white', color_func=genre_color_func).generate_from_frequencies(genre_counts)
 
 
 
 
 
 
 
 
129
 
130
  # Display the word cloud
131
  plt.figure(figsize=(10, 10))