Book Image

The Art of Data-Driven Business

By : Alan Bernardo Palacio
Book Image

The Art of Data-Driven Business

By: Alan Bernardo Palacio

Overview of this book

One of the most valuable contributions of data science is toward helping businesses make the right decisions. Understanding this complicated confluence of two disparate worlds, as well as a fiercely competitive market, calls for all the guidance you can get. The Art of Data-Driven Business is your invaluable guide to gaining a business-driven perspective, as well as leveraging the power of machine learning (ML) to guide decision-making in your business. This book provides a common ground of discussion for several profiles within a company. You’ll begin by looking at how to use Python and its many libraries for machine learning. Experienced data scientists may want to skip this short introduction, but you’ll soon get to the meat of the book and explore the many and varied ways ML with Python can be applied to the domain of business decisions through real-world business problems that you can tackle by yourself. As you advance, you’ll gain practical insights into the value that ML can provide to your business, as well as the technical ability to apply a wide variety of tried-and-tested ML methods. By the end of this Python book, you’ll have learned the value of basing your business decisions on data-driven methodologies and have developed the Python skills needed to apply what you’ve learned in the real world.
Table of Contents (17 chapters)
Part 1: Data Analytics and Forecasting with Python
Part 2: Market and Customer Insights
Part 3: Operation and Pricing Optimization

Installing Pytrends and ranking markets

As a first step, we need to install the package that we will use to analyze the web search data. We will install the Pytrends package, which is a wrapper around the Google Trends API. To do this, open a new Jupyter notebook running Python 3.7, and in a new cell run the following command to install the package:

pip install pytrends

After the package has been installed, we can start the analysis. We can run several types of queries to the API, which are as follows:

  • Interest over time
  • Historical hourly interest
  • Interest by region
  • Related topics
  • Related queries
  • Trending searches
  • Real-time search trends
  • Top charts
  • Suggestions

In this case, we want to obtain information about where the interest per region in a given set of terms is. These are steps that we will follow:

  1. Import the pandas package for storing the results and plotting the data.
  2. Initialize the Pytrends API and we will pass...