

WordCloud.generate(text) method will generate wordcloud from text. In this step, we create two important strings for our WorldCloud generation.

How column BLOOM looks like Create a simple WordCloud visual from a column in Pandas dataframe Below you can see the first ten rows from the dataframe. As an example, I will use a column named BLOOM from my dataframe named df1. In this article, I will demonstrate how easy it is to make your own worldcloud visuals from a column in Pandas datafreame. # Just to check that everything imported correctly from the csv file # My file did not have titles so I manually assigned themĭf1.columns = # Creating dataframe from csvĭf1 = pd.read_csv('Helpmefind_roses_merged_cleanned.csv') Next step is to import your csv file with data and create Pandas dataframe from it. Magic command %matplotlib inline will make your plot outputs appear and be stored within the notebook. # Run below comand if you are running IPython Import Libraries & Create a Dataframe # Importing librariesįrom wordcloud import WordCloud, STOPWORDS, ImageColorGenerator However, if you are after the library with the ability to mask the cloud into any shape of your choice, you will need the latest version that requires a different method of installation. Or conda install -c conda-forge wordcloud for Anaconda-Navigator. If you only need it for plotting a basic WordCloud, then running one of the commands below would be sufficient. The wordcloud library is the one responsible for creating WorldClouds. You will need this library to read in an image as the mask for the WordCloud. Pillow is a wrapper for PIL - Python Imaging Library. The pillow library is a package that enables image reading. In order to create a WorldCloud viz in Python you will need to install below packages:įirst four packages are data analytics staples, so don't require an introduction.
