Book Image

Practical Data Analysis Using Jupyter Notebook

By : Marc Wintjen
Book Image

Practical Data Analysis Using Jupyter Notebook

By: Marc Wintjen

Overview of this book

Data literacy is the ability to read, analyze, work with, and argue using data. Data analysis is the process of cleaning and modeling your data to discover useful information. This book combines these two concepts by sharing proven techniques and hands-on examples so that you can learn how to communicate effectively using data. After introducing you to the basics of data analysis using Jupyter Notebook and Python, the book will take you through the fundamentals of data. Packed with practical examples, this guide will teach you how to clean, wrangle, analyze, and visualize data to gain useful insights, and you'll discover how to answer questions using data with easy-to-follow steps. Later chapters teach you about storytelling with data using charts, such as histograms and scatter plots. As you advance, you'll understand how to work with unstructured data using natural language processing (NLP) techniques to perform sentiment analysis. All the knowledge you gain will help you discover key patterns and trends in data using real-world examples. In addition to this, you will learn how to handle data of varying complexity to perform efficient data analysis using modern Python libraries. By the end of this book, you'll have gained the practical skills you need to analyze data with confidence.
Table of Contents (18 chapters)
1
Section 1: Data Analysis Essentials
7
Section 2: Solutions for Data Discovery
12
Section 3: Working with Unstructured Big Data
16
Works Cited

From SQL to pandas DataFrames

Now that we have some background on SQL and relational databases, let's download a local copy of an SQLite database file, set up a connection, and load some data into a pandas DataFrame. For this example, I have provided the database file named customer_sales.db so be sure to download it from the GitHub repository beforehand.

To give you some context about this database file and support the Know Your Data(KYD) concept that we learned in Chapter 1, Fundamentalsof Data Analysis, we have three tables named tbl_customers, tbl_products, and tbl_sales. This would be a simple example of any company that has customers who purchase products that generate sales over any period of time. A visual representation of how the data is stored and joined together, which is commonly known as an ERD (short for Entity Relationship Diagram), is shown in the following diagram:

In the preceding diagram, we have a...