Coffee Break NumPy
Coffee Break NumPy
A Simple Road to Data Science Mastery That Fits Into Your Busy Life
About the Book
Do you want to learn data science 44% faster?
The new textbook Coffee Break NumPy leverages the scientifically proven way of puzzle-based learning to code!
"Students who were quizzed after studying a short text could recall significantly more information than students who were asked to reread it" (Karpicke, 2007b)
Fear of missing out on data science and machine learning? The trend of automation is not coming to a halt soon. Machines take over more and more traditional jobs from human workers.
But also highly-skilled knowledge workers such as doctors, traditional computer scientists, teachers, and financial analysts are under the danger to be replaced by machines.
This is the era of machine learning and data science.
And missing out on data science can be the #1 most costly mistake of your career.
But you're in luck: this eBook package gives you a fun way to start learning data science with Python. It gives you a thorough introduction in one of Python's most important libraries for data science and machine learning: NumPy.
I have written the book on the basis of the proven method of solving practical code puzzles and practice testing -- to make learning more fun, faster, and smarter.
And here's the best thing: practice testing is scientifically proven to generate up to 44% better learning retention and efficiency.
So what's in it for you?
- Understand NumPy code quickly.
- Learn all the basic NumPy concepts and data structures.
- Finally understand the most important NumPy functions and how to use them for practical problems.
As an additional bonus, you can track your individual NumPy coding skill level throughout the book. After reading the book, you'll know exactly how good you are in comparison to your friends and colleagues.
To get the most out of this book, you should know the basics of Python — e.g., you have already read my previous book "Coffee Break Python".
The book is packed with 211 pages of in-depth NumPy content:
- 46 educative code puzzles to test your skills and to make learning easy and fun!
- 10 tips for efficient learning to help you stop wasting time!
- 1 NumPy cheat sheets to learn 80% of the language features in 20% of the space!
- 1 accurate way to measure your coding skills because clarity is the first step to success!
- [BONUS] 1 detailed NumPy tutorial for absolute beginners to get you started!
Have your "Coffee Break NumPy" now! ;)
Packages
The Book
Includes:
Code Samples
Get all code from the book as Jupyter Notebook!
English
PDF
EPUB
eBook Package with 7 Video Tutorials
Learn the content faster with video! This package contains 7 Bonus Videos (NumPy Tutorial) from the author about the content of the book.
Includes:
Code Samples
Get all code from the book as Jupyter Notebook!
Instructional Video
A Full NumPy Course (8 Video Tutorials) from the Author.
English
PDF
EPUB
Bundles that include this book
Reader Testimonials

Chris C.
Real-world NumPy
"Another great little Python book from Christian and his colleagues. As a practitioner in this field, I really appreciate the focus on real-world problems. I can see my coffee breaks will be full for some time to come!"
Pepe
Fun and Engaging
The puzzle-solving methodology is very engaging and not very time demanding. Although far from being a computer scientist, I was able to strengthen my data science skills. I found this as engaging and exciting as the first one "Coffee Break Python" and I recommend it to every upcoming data scientist.
Table of Contents
Contents
1 Introduction 1
2 Why Learn NumPy? 5
3 A Case for Puzzle-based Learning 8
3.1 Overcome the Knowledge Gap . . . . . . . 10
3.2 Embrace the Eureka Moment . . . . . . . 11
3.3 Divide and Conquer . . . . . . . . . . . . 12
3.4 Improve From Immediate Feedback . . . . 14
3.5 Measure Your Skills . . . . . . . . . . . . . 15
3.6 Individualized Learning . . . . . . . . . . . 18
3.7 Small is Beautiful . . . . . . . . . . . . . . 19
3.8 Active Beats Passive Learning . . . . . . . 21
3.9 Make Code a First-class Citizen . . . . . . 23
3.10 What You See is All There is . . . . . . . 25
4 The Elo Rating for Python—and NumPy 27
4.1 How to Use This Book . . . . . . . . . . . 28
4.2 The Ideal Code Puzzle . . . . . . . . . . . 30
4.3 How to Exploit the Power of Habits? . . . 31
4.4 How to Test and Train Your Skills? . . . . 32
4.5 What Can This Book Do For You? . . . . 36
5 A Quick Data Science Tutorial: The NumPy Library 40
5.1 What is NumPy? . . . . . . . . . . . . . . 41
5.2 What can NumPy do for me? . . . . . . . 42
5.3 What are the Limitations of NumPy? . . . 44
5.4 What are the Linear Algebra Basics You
Need to Know? . . . . . . . . . . . . . . . 45
5.5 What are Arrays and Matrices in NumPy? 54
5.6 What are Axes and the Shape of an Array? 57
5.7 How to Create and Initialize NumPy Arrays? 60
5.8 How does indexing and slicing work in Python? 67
5.9 How Does Indexing and Slicing Work in
NumPy? . . . . . . . . . . . . . . . . . . . 72
5.10 NumPy Cheat Sheet . . . . . . . . . . . . 79
6 NumPy Basics 81
6.1 NumPy 1D Array Creation . . . . . . . . . 82
6.2 NumPy 2D Array Creation . . . . . . . . . 84
6.3 Extracting Array Dimensionality . . . . . 86
6.4 Accessing Array Shape . . . . . . . . . . . 89
6.5 Averaging 1D Arrays . . . . . . . . . . . . 92
6.6 Working with Not a Number the Wrong
Way . . . . . . . . . . . . . . . . . . . . . 95
6.7 Working with Not a Number the Right Way 97
6.8 Creating Numerical Sequences . . . . . . . 99
6.9 Creating Numerical Intervals . . . . . . . . 101
6.10 Initializing Multi-Dimensional Arrays . . . 103
6.11 Revisiting Linear Algebra . . . . . . . . . 106
6.12 Understanding the Hadamard Product . . 108
6.13 Broadcasting . . . . . . . . . . . . . . . . 111
6.14 Practicing Simple Indexing . . . . . . . . . 114
6.15 The Boolean Indexing Trick . . . . . . . . 117
6.16 Slicing Matrices Like Paper . . . . . . . . 119
6.17 Simple Array Logic . . . . . . . . . . . . . 123
6.18 Mastering Slice Assignments . . . . . . . . 126
6.19 Sorting an Array (Part 1) . . . . . . . . . 128
6.20 Sorting an Array (Part 2) . . . . . . . . . 130
6.21 Computing Array Element Differences . . 133
6.22 Computing Array of Cumulative Sums . . 135
7 Linear Algebra and Statistics 137
7.1 Calculating 1D Dot Product . . . . . . . . 137
7.2 Multiplying 2D Matrices . . . . . . . . . . 141
7.3 Enhancing Vector Operations . . . . . . . 144
7.4 Linear Algebra Made Simple . . . . . . . . 147
7.5 Revisiting Average . . . . . . . . . . . . . 151
7.6 Reshaping 1D Arrays . . . . . . . . . . . . 153
7.7 Averaging 2D Arrays . . . . . . . . . . . . 156
7.8 Weighted Averaging Along Axes . . . . . . 158
7.9 Calculating 1D Variance . . . . . . . . . . 161
7.10 Axis Variance of a 2D Array . . . . . . . . 163
7.11 1D Axis Standard Deviation . . . . . . . . 166
8 Practical Data Science 169
8.1 Statistical Operations . . . . . . . . . . . . 169
8.2 Data Cleaning or Living in an Unperfect
World . . . . . . . . . . . . . . . . . . . . 172
8.3 Understandig the Basics of Filters . . . . . 174
8.4 Creating Filters . . . . . . . . . . . . . . . 176
8.5 Mastering the Power of Filters . . . . . . . 178
8.6 Applying Filters . . . . . . . . . . . . . . . 180
8.7 Finding Array Elements . . . . . . . . . . 182
8.8 Leveraging Data Science to Boost Revenues
I . . . . . . . . . . . . . . . . . . . . . . . 184
8.9 Leveraging Data Science to Boost Revenues
II . . . . . . . . . . . . . . . . . . . . . . . 188
8.10 Finding and Locating Maximum Elements 192
8.11 Computing Number of Hospital Patients . 196
8.12 Finding Chunks of Allocated Memory . . . 199
8.13 Giving Meaning to the Mean . . . . . . . . 203
9 Final Remarks 207
Your skill level . . . . . . . . . . . . . . . 208
Where to go from here? . . . . . . . . . . 209
Authors have earned$10,088,725writing, publishing and selling on Leanpub, earning 80% royalties while saving up to 25 million pounds of CO2 and up to 46,000 trees.
Learn more about writing on Leanpub
The Leanpub 45-day 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets) and MOBI (for Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them
Top Books
C++20
Rainer GrimmC++20 is the next big C++ standard after C++11. As C++11 did it, C++20 changes the way we program modern C++. This change is, in particular, due to the big four of C++20: ranges, coroutines, concepts, and modules.
The book is almost daily updated. These incremental updates ease my interaction with the proofreaders.
C++ Best Practices
Jason TurnerLevel up your C++, get the tools working for you, eliminate common problems, and move on to more exciting things!
Atomic Kotlin
Bruce Eckel and Svetlana IsakovaFor both beginning and experienced programmers! From the author of the multi-award-winning Thinking in C++ and Thinking in Java together with a member of the Kotlin language team comes a book that breaks the concepts into small, easy-to-digest "atoms," along with exercises supported by hints and solutions directly inside IntelliJ IDEA!
Sockets and Pipes
Type ClassesSockets and Pipes is not an introduction to Haskell; it is an introduction to writing software in Haskell. Using a handful of everyday Haskell libraries, this book walks through reading the HTTP specification and implementing it to create a web server.
Introducing EventStorming
Alberto BrandoliniThe deepest tutorial and explanation about EventStorming, straight from the inventor.
Composing Software
Eric ElliottAll software design is composition: the act of breaking complex problems down into smaller problems and composing those solutions. Most developers have a limited understanding of compositional techniques. It's time for that to change.
Cloud Strategy
Gregor Hohpe“Strategy is the difference between making a wish and making it come true.” A successful migration to the cloud can transform your organization, but it shouldn’t be driven by wishes. This book tells you how to develop a sound strategy guided by frameworks and decision models without being overly abstract nor getting lost in product details.
node-opcua by example
Etienne RossignonGet the best out of node-opcua through a set of documented examples by the author himself that will allow you to create stunning OPCUA Servers or Clients.
Functional Design and Architecture
Alexander GraninSoftware Design in Functional Programming, Design Patterns and Practices, Methodologies and Application Architectures. How to build real software in Haskell with less efforts and low risks. The first complete source of knowledge.
Ansible for DevOps
Jeff GeerlingAnsible is a simple, but powerful, server and configuration management tool. Learn to use Ansible effectively, whether you manage one server—or thousands.
Top Bundles
- #1
Software Architecture for Developers: Volumes 1 & 2 - Technical leadership and communication
2 Books
"Software Architecture for Developers" is a practical and pragmatic guide to modern, lightweight software architecture, specifically aimed at developers. You'll learn:The essence of software architecture.Why the software architecture role should include coding, coaching and collaboration.The things that you really need to think about before... - #2
Django for Beginners/APIs/Professionals
3 Books
- #3
PowerShell
3 Books
Buy every PowerShell book from Adam Bertram at a 20% discount! - #4
CCIE Service Provider Ultimate Study Bundle
2 Books
Piotr Jablonski, Lukasz Bromirski, and Nick Russo have joined forces to deliver the only CCIE Service Provider training resource you'll ever need. This bundle contains a detailed and challenging collection of workbook labs, plus an extensively detailed technical reference guide. All of us have earned the CCIE Service Provider certification... - #5
Cisco CCNA 200-301 Complet
4 Books
Ce lot comprend les quatre volumes du guide préparation à l'examen de certification Cisco CCNA 200-301. - #6
All the Books of The Medical Futurist
6 Books
We put together the most popular books from The Medical Futurist to provide a clear picture about the major trends shaping the future of medicine and healthcare. Digital health technologies, artificial intelligence, the future of 20 medical specialties, big pharma, data privacy, digital health investments and how technology giants such as Amazon... - #7
Linux Administration Complet
4 Books
Ce lot comprend les quatre volumes du Guide Linux Administration :Linux Administration, Volume 1, Administration fondamentale : Guide pratique de préparation aux examens de certification LPIC 1, Linux Essentials, RHCSA et LFCS. Administration fondamentale. Introduction à Linux. Le Shell. Traitement du texte. Arborescence de fichiers. Sécurité... - #8
Software Architecture and Beautiful APIs
2 Books
There is no better way to learn how to design good APIs than to look at many existing examples, complementing the Software Architecture theory on API design. - #9
Learn Git, Bash, and Terraform the Hard Way
3 Books
Learn Git, Bash and Terraform using the Hard Way method.These technologies are essential tools in the DevOps armoury. These books walk you through their features and subtleties in a simple, gradual way that reinforces learning rather than baffling you with theory. - #10
9 Books-Bundle: Shut Up and Code!
9 Books
"Shut up and code." Laughter in the audience. The hacker had just plugged in his notebook and started sharing his screen to present his super-smart Python script. "Shut up and code" The letters written in a white literal coding font on black background was the hackers' home screen background mantra. At the time, I was a first-year computer...