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!
PDF
EPUB
English
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.
PDF
EPUB
English
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
Other books by these authors
The Leanpub 60-day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms
Do Well. Do Good.
Authors have earned$11,577,045writing, 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
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
Recipes for Decoupling
Matthias NobackSignalR on .NET 6 - the Complete Guide
Fiodar SazanavetsLearn everything there is to learn about SignalR and how to integrate it with the latest .NET 6 and C# 10 features. Learn how to connect any type of client to SignalR, including plain WebSocket client. Learn how to build interactive applications that can communicate with each other in real time without making excessive calls.
The BDD Books - Discovery (Japanese Edition)
Gáspár Nagy, Seb Rose, and Yuya Kazamaウクライナ難民を支援 - 2022年5月末まで延長!
この本の売り上げの50%は、 https://unicef.hu/veszhelyzet-ukrajnaban と https://int.depaulcharity.org/fundraising-for-depaul-ukraine/ に寄付されます。
本書籍は、振る舞い駆動開発(Behavior Driven Development, BDD)や受け入れテスト駆動開発(Acceptance Test-Driven Development, ATDD)の発見フェーズを最大限に活用する方法を提供します。
The easiest way to learn design patterns
Fiodar SazanavetsLearn design patterns in the easiest way possible. You will no longer have to brute-force your way through each one of them while trying to figure out how it works. The book provides a unique methodology that will make your understanding of design patterns stick. It can also be used as a reference book where you can find design patterns in seconds.
Agile Testing Condensed Japanese Edition
Yuya Kazama, Janet Gregory, and Lisa CrispinJanet GregoryとLisa Crispinによる2019年9月発行の書籍『Agile Testing Condensed』の日本語翻訳版です。アジャイルにおいてどのような考えでテストを行うべきなのか簡潔に書かれています!
OpenIntro Statistics
David Diez, Christopher Barr, Mine Cetinkaya-Rundel, and OpenIntroA complete foundation for Statistics, also serving as a foundation for Data Science.
Leanpub revenue supports OpenIntro (US-based nonprofit) so we can provide free desk copies to teachers interested in using OpenIntro Statistics in the classroom and expand the project to support free textbooks in other subjects.
More resources: openintro.org.
Tech Giants in Healthcare
Dr. Bertalan MeskoThis comprehensive guide, Tech Giants in Healthcare, clarifies how and why big tech companies step into healthcare, and breaks it down from one market player to the other in what direction they are going, what tools they are using and what horizons they have in front of them.
Functional event-driven architecture: Powered by Scala 3
Gabriel VolpeExplore the event-driven architecture (EDA) in a purely functional way, mainly powered by Fs2 streams in Scala 3!
Leverage your functional programming skills by designing and writing stateless microservices that scale, powered by stateful message brokers.
CCIE Service Provider Version 4 Written and Lab Exam Comprehensive Guide
Nicholas RussoThe service provider landscape has changed rapidly over the past several years. Networking vendors are continuing to propose new standards, techniques, and procedures for overcoming new challenges while concurrently reducing costs and delivering new services. Cisco has recently updated the CCIE Service Provider track to reflect these changes; this book represents the author's personal journey in achieving that certification.
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
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... - #2
Practical FP in Scala + Functional event-driven architecture
2 Books
Practical FP in Scala (A hands-on approach) & Functional event-driven architecture, aka FEDA, (Powered by Scala 3), together as a bundle! The content of PFP in Scala is a requirement to understand FEDA so why not take advantage of this bundle!? - #3
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... - #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... - #6
Pattern-Oriented Memory Forensics and Malware Detection
2 Books
This training bundle for security engineers and researchers, malware and memory forensics analysts includes two accelerated training courses for Windows memory dump analysis using WinDbg. It is also useful for technical support and escalation engineers who analyze memory dumps from complex software environments and need to check for possible... - #8
Modern C++ Collection
3 Books
Get All about Modern C++C++ Standard Library, including C++20Concurrency with Modern C++, including C++20C++20Each book has about 200 complete code examples. Updates are included. When I update one of the books, you immediately get the updated bundle. You can expect significant updates to each new C++ standard (C++23, C++26, .. ) and also...