Data Science from Scratch: First Principles with Python, 2nd Edition
By Joel Grus
About this ebook
Data Science from Scratch, 2nd Edition, teaches the mathematics and algorithms behind data analysis through Python implementations. Joel Grus covers linear algebra, statistics, probability, optimization, and machine learning by building core methods directly. It is intended for readers who want to understand data science models as well as use them.
Inside this title
Python implementations expose the calculations behind data science algorithms
Current listed price $20.00Regular price $37.00Digital ebook
Writing the underlying calculations is the central learning method in this book. Python examples introduce vectors, matrices, statistical summaries, probability, and hypothesis testing before moving into optimization and predictive models. Implementing these pieces makes the relationship between mathematical ideas and program behavior explicit.
Gradient descent leads into machine learning topics including decision trees, random forests, neural networks, clustering, and dimensionality reduction. Natural language processing provides further applications of the earlier statistical concepts. Alongside these models, the text considers collecting, cleaning, and visualizing data. Programmers and developing data scientists can follow the implementations to examine how the main components of an analysis fit together.
Study guide included
Inside Data Science from Scratch: First Principles with Python, 2nd Edition.
Grus teaches data science by making readers build it: vectors, probability, then gradient descent, trees, neural networks and clustering, with text processing and data cleaning along the way. Every method is written in Python, so the arithmetic behind familiar libraries becomes visible rather than assumed.
The organizing idea is that writing the calculation is how you learn it. Linear algebra, statistics and probability come first, because later models lean on them. Optimization is introduced as a general procedure, then applied to predictive methods: decision trees, random forests, neural networks, clustering and dimensionality reduction. Natural language processing shows the same statistical ideas working on text. The closing material turns to the mundane side of analysis, gathering, cleaning and plotting data. Readers work in Python throughout, so model behavior and code behavior stay tied together. It suits programmers and newer data scientists who want the mechanics, not just the API calls.
Mathematics Built by Hand
Vectors, matrices, statistical summaries and probability are introduced as things the reader constructs in code. Because each operation is written out, the link between a symbolic expression and what a program actually computes stays explicit. This groundwork is what later chapters quietly assume.
Vectors and matrices carry the core operations
Statistical summaries describe a dataset
Probability supplies the language for uncertainty
Topics 1–2
Probability, Inference and Testing
The text moves from probability to hypothesis testing, treating inference as a procedure with assumptions rather than a verdict machine. Readers see how a test is assembled and what its output does and does not support. The aim is to make statistical claims inspectable.
Distributions model uncertainty
Hypothesis tests rest on stated assumptions
Results need interpretation, not just lookup
Topics 2–3
Optimization as the Learning Engine
Gradient descent is presented as a general way of improving a model step by step. Rather than hiding it inside a library, the book derives the update and implements it, so the connection between a loss function and learning becomes concrete. Later models reuse this same machinery.
A loss function defines what to improve
Gradient descent iterates toward lower loss
The learning rate shapes how the search behaves
Topic 4
Predictive Models
Trees lead into ensembles, neural networks and then unsupervised methods. Each model is built from the tools already covered, which makes the differences between them a matter of structure rather than magic. Clustering and dimensionality reduction extend the discussion to data without labels.
Trees split data by informative features
Ensembles combine many weak models
Clustering and reduction work without labels
Topics 5–6
Text as Data
Natural language processing applies the earlier statistics to words, showing how text can be represented and analyzed. The treatment is practical rather than exhaustive, keeping the focus on how techniques carry over from numerical data to language.
Text must be represented before analysis
Statistical methods transfer to language tasks
Applications follow the same implementation approach
Topic 7
The Unglamorous Work of Data
Collecting, cleaning and visualizing data get their own attention, since a model is only as good as the data feeding it. Visualization is treated as a way to inspect and communicate, not decoration. This section grounds the modeling chapters in the reality of messy inputs.
Collection decisions shape later results
Cleaning addresses inconsistent data
Visualization supports inspection and explanation
Topic 8
Topic map
Vectors, Matrices and Linear AlgebraTopic 1
Statistics and Probability FundamentalsTopic 2
Hypothesis Testing and InferenceTopic 3
Optimization and Gradient DescentTopic 4
Trees, Forests and Neural NetworksTopic 5
Clustering and Dimensionality ReductionTopic 6
Natural Language ProcessingTopic 7
Collecting, Cleaning and Visualizing DataTopic 8
Key takeaways
The code is the explanation; typing the algorithms is the intended way to learn them.
Read the mathematics before the models, because each model reuses earlier machinery.
Treat data preparation as part of the analysis, not a preliminary chore.
Programmers moving into data work and newer data scientists who want to understand the calculations behind common methods rather than only call them.
Topics covered
data science from scratch
python data science
machine learning fundamentals
gradient descent
linear algebra for data science
probability and statistics
natural language processing
Joel Grus
Questions about this ebook.
Edition, audience, and study-guide details at a glance.
What is Data Science from Scratch: First Principles with Python, 2nd Edition about?
Data Science from Scratch, 2nd Edition, teaches the mathematics and algorithms behind data analysis through Python implementations. Joel Grus covers linear algebra, statistics, probability, optimization, and machine learning by building core methods directly. It is intended for readers who want to understand data science models as well as use them.
Which edition of Data Science from Scratch: First Principles with Python, 2nd Edition is this?
This listing is for the 2nd edition. Check the title, ISBN, and book details above before ordering, especially if your course or reading list names a specific edition.
Who is Data Science from Scratch: First Principles with Python, 2nd Edition for?
Programmers moving into data work and newer data scientists who want to understand the calculations behind common methods rather than only call them.
Does this page include a study guide?
Yes. This page includes an original study guide with six thematic sections, key takeaways, and a topic map for structured reading.