Book Image

Python Business Intelligence Cookbook

Book Image

Python Business Intelligence Cookbook

Overview of this book

The amount of data produced by businesses and devices is going nowhere but up. In this scenario, the major advantage of Python is that it's a general-purpose language and gives you a lot of flexibility in data structures. Python is an excellent tool for more specialized analysis tasks, and is powered with related libraries to process data streams, to visualize datasets, and to carry out scientific calculations. Using Python for business intelligence (BI) can help you solve tricky problems in one go. Rather than spending day after day scouring Internet forums for “how-to” information, here you’ll find more than 60 recipes that take you through the entire process of creating actionable intelligence from your raw data, no matter what shape or form it’s in. Within the first 30 minutes of opening this book, you’ll learn how to use the latest in Python and NoSQL databases to glean insights from data just waiting to be exploited. We’ll begin with a quick-fire introduction to Python for BI and show you what problems Python solves. From there, we move on to working with a predefined data set to extract data as per business requirements, using the Pandas library and MongoDB as our storage engine. Next, we will analyze data and perform transformations for BI with Python. Through this, you will gather insightful data that will help you make informed decisions for your business. The final part of the book will show you the most important task of BI—visualizing data by building stunning dashboards using Matplotlib, PyTables, and iPython Notebook.
Table of Contents (12 chapters)
Python Business Intelligence Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Exporting an IPython Notebook Dashboard to an HTML slideshow


In this recipe, you'll learn how to export an IPython Notebook Dashboard to an HTML file. The dashboard we have created will export to a single page; however, you can easily turn it into multiple slides for a presentation. Also, this is my preferred HTML export method, so I recommend using it.

Converting a notebook to slides generates a reveal.js HTML slideshow. In order to work correctly, it must be served by a web server.

If you produce actual slides from your notebook, download the reveal.js library (https://github.com/hakimel/reveal.js) to make them interactive.

Creating even a single-page slideshow is my preference, as I believe it looks the best of all the exported formats.

How to do it…

  1. First, build your dashboard.

  2. Next, change into the directory containing your notebook file.

  3. Lastly, run the following command:

    jupyter nbconvert --to slides --execute 'name_of_notebook.ipynb'
    

How it works…

With the dashboard created, we use nbconvert...