Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
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 1. Part 1 – Introduction to pandas
2. Chapter 1: Introduction to pandas 3. Chapter 2: Working with Data Structures 4. Chapter 3: Data I/O 5. Chapter 4: Pandas Data Types 6. Part 2 – Working with Data
7. Chapter 5: Data Selection – DataFrames 8. Chapter 6: Data Selection – Series 9. Chapter 7: Data Exploration and Transformation 10. Chapter 8: Understanding Data Visualization 11. Part 3 – Data Modeling
12. Chapter 9: Data Modeling – Preprocessing 13. Chapter 10: Data Modeling – Modeling Basics 14. Chapter 11: Data Modeling – Regression Modeling 15. Part 4 – Additional Use Cases for pandas
16. Chapter 12: Using Time in pandas 17. Chapter 13: Exploring Time Series 18. Chapter 14: Applying pandas Data Processing for Case Studies 19. Chapter 15: Appendix 20. Other Books You May Enjoy

Exploring regression modeling

You have already used regression models in Chapter 9 and Chapter 10. Here, we will go deeper into regression modeling and compare linear and non-linear models for data modeling. A famous early example of regression analysis was produced by Sir Francis Galton, who lived in England from 1822 to 1911. Among many activities, Galton collected data on the heights of fathers and mothers and their adult children. It is notable that today, the data would be considered biased, as the sample was most likely from more affluent families that had access to better nutrition and living conditions than the average for the time in England. Nonetheless, the data serves as a good introduction to regression:

  1. Here, we load a simplified version of the data (adapted from the original) into a pandas DataFrame and plot the heights of all the children and the fathers:
    galton_heights = pd.read_csv('Datasets/galton.csv')
    galton_heights.head()

This produces...

lock icon The rest of the chapter is locked
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}