I am trying to generate a WordCloud in Python from a .csv file.
This is how my .csv file looks like:
title,views
universe,45678
earth,34366
smtp,4567987
This is what I did to create the WordCloud:
import csv
import matplotlib.pyplot as pPlot
from wordcloud import WordCloud, STOPWORDS
reader = csv.reader(open('C:/Users/Sushma/Downloads/wordcloud.csv', 'r', newline = '\n', encoding = 'utf-8'))
for k, v in reader:
d[k] = float(v)
wordcloud = WordCloud().generate_from_frequencies(d)
If I print WordCloud, I get an object id.
Can anybody please suggest how to save this as an image and how to view it on Python?