This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Function to generate word cloud with dark red contour | |
def generate_better_wordcloud(data, title, mask=None): | |
cloud = WordCloud(scale=3, | |
max_words=150, | |
colormap='RdYlGn', | |
mask=mask, | |
background_color='white', | |
stopwords=stopwords, | |
collocations=True, | |
contour_color='#5d0f24', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from wordcloud import ImageColorGenerator | |
#Create the mask | |
colosseum_mask = np.array(Image.open('/Users/tiaplagata/Downloads/colosseum.jpg')) | |
#Grab the mask colors | |
colors = ImageColorGenerator(colosseum_mask) | |
#Instantiate the wordcloud using color_func argument | |
cloud = WordCloud(mask=colosseum_mask, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Function to generate word cloud with basic contour | |
def generate_better_wordcloud(data, title, mask=None): | |
cloud = WordCloud(scale=3, | |
max_words=150, | |
colormap='RdYlGn', | |
mask=mask, | |
background_color='white', | |
stopwords=stopwords, | |
collocations=True, | |
contour_color='black', |
OlderNewer