O'Reilly logo

Learning Python Data Visualization by Chad Adams

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Modifying our RSS to return values

As we are using our LoadRssFeed as a library module now, we will want to modify the end result to return an array we can use in our chart module that we will build shortly. We will return two counts both in an array, one for May and one for June.

Also, we will remove the print statement as we understand that it is working properly. So, remove the print line at the end of the LoadRssFeed, get_all_rss_dates function and replace it with return [month_count.count(5), month_count.count(6)]. This will allow us to return a single object but keep two values for our chart. Here's the implementation of the file:

#!/usr/bin/env python # -*- coding: utf-8 -*- import urllib2 from xml.etree import ElementTree import time def ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required