Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
The Pandas Workshop

You're reading from  The Pandas Workshop

Product type Book
Published in Jun 2022
Publisher Packt
ISBN-13 9781800208933
Pages 744 pages
Edition 1st Edition
Languages
Authors (4):
Blaine Bateman Blaine Bateman
Profile icon Blaine Bateman
Saikat Basak Saikat Basak
Profile icon Saikat Basak
Thomas V. Joseph Thomas V. Joseph
Profile icon Thomas V. Joseph
William So William So
Profile icon William So
View More author details

Table of Contents (21) Chapters

Preface Part 1 – Introduction to pandas
Chapter 1: Introduction to pandas Chapter 2: Working with Data Structures Chapter 3: Data I/O Chapter 4: Pandas Data Types Part 2 – Working with Data
Chapter 5: Data Selection – DataFrames Chapter 6: Data Selection – Series Chapter 7: Data Exploration and Transformation Chapter 8: Understanding Data Visualization Part 3 – Data Modeling
Chapter 9: Data Modeling – Preprocessing Chapter 10: Data Modeling – Modeling Basics Chapter 11: Data Modeling – Regression Modeling Part 4 – Additional Use Cases for pandas
Chapter 12: Using Time in pandas Chapter 13: Exploring Time Series Chapter 14: Applying pandas Data Processing for Case Studies Chapter 15: Appendix Other Books You May Enjoy

Activity 1.01 – comparing sales data for two stores

ABC Corporation is a retail company with two big stores for grocery and stationery products. The company is planning to create an ambitious marketing campaign next year. As a data analyst, your task is to derive the following insights from the data and relay those insights to the sales team so that they can plan the campaign effectively:

  • Which store has greater sales for the quarter?
  • Which store has the highest sales for grocery products?
  • Which store has the highest sales for March?
  • For how many days were the sales of stationery products greater in store 1 than in store 2?

In this activity, you will create the datasets for the two stores and use all the methods you have learned so far to answer the preceding questions. The following steps will help you complete this activity:

  1. Open a new Jupyter notebook.
  2. Load the data that corresponds to the two stores (Store1.csv and Store2.csv). These datasets are available in this book's GitHub repository at https://github.com/PacktWorkshops/The-Pandas-Workshop/tree/master/Chapter01/Datasets.
  3. Use the different methods you have learned about in this chapter to answer the questions.
  4. Print the resulting DataFrames. Note that the DataFrames you create should be in the following format:
Figure 1.63 – Final output

Figure 1.63 – Final output

With that, we have covered everything you need to know to get started with pandas.

Note

You can find the solution for this activity in the Appendix.

You have been reading a chapter from
The Pandas Workshop
Published in: Jun 2022 Publisher: Packt ISBN-13: 9781800208933
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}