Evolution…

I have found out a couple of days ago that the evolution of the libraries in the Python ecosystem is FAST. It is not only fast, it is exceptionally fast. In my opinion some of these libraries are evolving together with the market and mainly for market reasons (one of these libraries is Pandas, part of the code in one of my early articles does not work any more because the DataReader is no longer part of the library but it is now included in a new library called pandas-datareader.

This is quite normal, the core Pandas has been included in so many projects that it needs to be stable to the maximum while the services on which pandas.io former DataReader relied are far from stable.  Other libraries are evolving because they are just getting better, like for instance the wordcloud library by A. Mueller. Also in that case, my articles on word clouds in python  (at the time based on Python 2.7, now I only do Python 3.5 and above) do longer work without some adjustments. But the library is evolving constantly and becomes more and more capable, that is why I decided to give it another go, with a new example based on the last version of the library, that adds contours (BTW, the package includes a standalone, command-line wordcloud generator.

Let us see.. this wordcloud is dedicated to the Neapolitan actor Totò, and it is built from the text of a few of his poems and songs.  The stop words are augmented as the text is partially in Italian and partially in Neapolitan.  This is similar to what I have done here.

These are the necessary imports…

Then I get the words from a text file I have put together using the original poems and song lyrics from this site, dedicated to Totò.

And finally, I create the stop words list and generate the wordcloud, using a mask and with a border.

And this is the result!