on-internet
← Community

TypeError: expected string or bytes-like object ( Python 3) ( Wordcloud)

Stack Overflow ·

import pandas as pd import matplotlib.pyplot as plt from PIL import Image import numpy as np import wordcloud from wordcloud import WordCloud,STOPWORDS # Read the whole text. remarks = open(r'C:\Users\marmar\Remarks.txt').read().split() #Create words over an image mask = np.array(Image.open(r'C:\users\marmar\Documents\cloud.png')) #set the stopwords list stopwords= set(STOPWORDS) #append new words to the stopwords list new_words =open(r'C:\Users\marmar\Documents\comments.txt').read().split() new_stopwords=stopwords.union(new_words) #generate the word cloud with parameters wc = WordCloud( backg

Comments

Sign in or sign up to comment and upvote.

No comments yet.