Python Business Intelligence Cookbook

Leverage the computational power of Python with more than 60 recipes that arm you with the required skills to make informed business decisions

Python Business Intelligence Cookbook

This ebook is included in a Mapt subscription
Robert Dempsey

3 customer reviews
Leverage the computational power of Python with more than 60 recipes that arm you with the required skills to make informed business decisions
$0.00
$16.00
$39.99
$29.99p/m after trial
RRP $31.99
RRP $39.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781785287466
Paperback202 pages

Book Description

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

Chapter 1: Getting Set Up to Gain Business Intelligence
Introduction
Installing Anaconda
Learn about the Python libraries we will be using
Installing, configuring, and running MongoDB
Installing Rodeo
Starting Rodeo
Installing Robomongo
Using Robomongo to query MongoDB
Downloading the UK Road Safety Data dataset
Chapter 2: Making Your Data All It Can Be
Importing a CSV file into MongoDB
Importing an Excel file into MongoDB
Importing a JSON file into MongoDB
Importing a plain text file into MongoDB
Retrieving a single record using PyMongo
Retrieving multiple records using PyMongo
Inserting a single record using PyMongo
Inserting multiple records using PyMongo
Updating a single record using PyMongo
Updating multiple records using PyMongo
Deleting a single record using pymongo
Deleting multiple records using PyMongo
Importing a CSV file into a Pandas DataFrame
Renaming column headers in Pandas
Filling in missing values in Pandas
Removing punctuation in Pandas
Removing whitespace in Pandas
Removing any string from within a string in Pandas
Merging two datasets in Pandas
Titlecasing anything
Uppercasing a column in Pandas
Updating values in place in Pandas
Standardizing a Social Security number in Pandas
Standardizing dates in Pandas
Converting categories to numbers in Pandas for a speed boost
Chapter 3: Learning What Your Data Truly Holds
Creating a Pandas DataFrame from a MongoDB query
Creating a Pandas DataFrame from a CSV file
Creating a Pandas DataFrame from an Excel file
Creating a Pandas DataFrame from a JSON file
Creating a data quality report
Generating summary statistics for the entire dataset
Generating summary statistics for object type columns
Getting the mode of the entire dataset
Generating summary statistics for a single column
Getting a count of unique values for a single column
Getting the minimum and maximum values of a single column
Generating quantiles for a single column
Getting the mean, median, mode, and range for a single column
Generating a frequency table for a single column by date
Generating a frequency table of two variables
Creating a histogram for a column
Plotting the data as a probability distribution
Plotting a cumulative distribution function
Showing the histogram as a stepped line
Plotting two sets of values in a probability distribution
Creating a customized box plot with whiskers
Creating a basic bar chart for a single column over time
Chapter 4: Performing Data Analysis for Non Data Analysts
Performing a distribution analysis
Performing categorical variable analysis
Performing a linear regression
Performing a time-series analysis
Performing outlier detection
Creating a predictive model using logistic regression
Creating a predictive model using a random forest
Creating a predictive model using Support Vector Machines
Saving a predictive model for production use
Chapter 5: Building a Business Intelligence Dashboard Quickly
Creating reports in Excel directly from a Pandas DataFrame
Creating customizable Excel reports using XlsxWriter
Building a shareable dashboard using IPython Notebook and matplotlib
Exporting an IPython Notebook Dashboard to HTML
Exporting an IPython Notebook Dashboard to PDF
Exporting an IPython Notebook Dashboard to an HTML slideshow
Building your First Flask application in 10 minutes or less
Creating and saving your plots for your Flask BI dashboard
Building a business intelligence dashboard in Flask

What You Will Learn

  • Install Anaconda, MongoDB, and everything you need to get started with your data analysis
  • Prepare data for analysis by querying cleaning and standardizing data
  • Explore your data by creating a Pandas data frame from MongoDB
  • Gain powerful insights, both statistical and predictive, to make informed business decisions
  • Visualize your data by building dashboards and generating reports
  • Create a complete data processing and business intelligence system

Authors

Table of Contents

Chapter 1: Getting Set Up to Gain Business Intelligence
Introduction
Installing Anaconda
Learn about the Python libraries we will be using
Installing, configuring, and running MongoDB
Installing Rodeo
Starting Rodeo
Installing Robomongo
Using Robomongo to query MongoDB
Downloading the UK Road Safety Data dataset
Chapter 2: Making Your Data All It Can Be
Importing a CSV file into MongoDB
Importing an Excel file into MongoDB
Importing a JSON file into MongoDB
Importing a plain text file into MongoDB
Retrieving a single record using PyMongo
Retrieving multiple records using PyMongo
Inserting a single record using PyMongo
Inserting multiple records using PyMongo
Updating a single record using PyMongo
Updating multiple records using PyMongo
Deleting a single record using pymongo
Deleting multiple records using PyMongo
Importing a CSV file into a Pandas DataFrame
Renaming column headers in Pandas
Filling in missing values in Pandas
Removing punctuation in Pandas
Removing whitespace in Pandas
Removing any string from within a string in Pandas
Merging two datasets in Pandas
Titlecasing anything
Uppercasing a column in Pandas
Updating values in place in Pandas
Standardizing a Social Security number in Pandas
Standardizing dates in Pandas
Converting categories to numbers in Pandas for a speed boost
Chapter 3: Learning What Your Data Truly Holds
Creating a Pandas DataFrame from a MongoDB query
Creating a Pandas DataFrame from a CSV file
Creating a Pandas DataFrame from an Excel file
Creating a Pandas DataFrame from a JSON file
Creating a data quality report
Generating summary statistics for the entire dataset
Generating summary statistics for object type columns
Getting the mode of the entire dataset
Generating summary statistics for a single column
Getting a count of unique values for a single column
Getting the minimum and maximum values of a single column
Generating quantiles for a single column
Getting the mean, median, mode, and range for a single column
Generating a frequency table for a single column by date
Generating a frequency table of two variables
Creating a histogram for a column
Plotting the data as a probability distribution
Plotting a cumulative distribution function
Showing the histogram as a stepped line
Plotting two sets of values in a probability distribution
Creating a customized box plot with whiskers
Creating a basic bar chart for a single column over time
Chapter 4: Performing Data Analysis for Non Data Analysts
Performing a distribution analysis
Performing categorical variable analysis
Performing a linear regression
Performing a time-series analysis
Performing outlier detection
Creating a predictive model using logistic regression
Creating a predictive model using a random forest
Creating a predictive model using Support Vector Machines
Saving a predictive model for production use
Chapter 5: Building a Business Intelligence Dashboard Quickly
Creating reports in Excel directly from a Pandas DataFrame
Creating customizable Excel reports using XlsxWriter
Building a shareable dashboard using IPython Notebook and matplotlib
Exporting an IPython Notebook Dashboard to HTML
Exporting an IPython Notebook Dashboard to PDF
Exporting an IPython Notebook Dashboard to an HTML slideshow
Building your First Flask application in 10 minutes or less
Creating and saving your plots for your Flask BI dashboard
Building a business intelligence dashboard in Flask

Book Details

ISBN 139781785287466
Paperback202 pages
Read More
From 3 reviews

Read More Reviews