View Post

How to Filter in Python using Lambda Functions?

Real-world data is noisy. But as a data scientist, you get paid to get rid of the noise, make the data accessible, and create meaning. Thus, filtering data is vital for real-world data science tasks. In this article, you’ll learn how to create a minimal filter function in a single line of code. I first give you the code and …

View Post

How to Start Earning Money as a Python Coder at Freelancer.com?

Want to earn more money on the side — and learn to code Python in the process? Becoming a Python freelancer may just be the small side-business you have been looking for. You can work from home, create your new and valuable high-income skill Python development, and push your communication skills to the next level. Watch this video to see …

View Post

The Ultimate Introduction to Sorting in NumPy

Imagine you need to find a book in your bookshelf. What situation would you prefer: A) your bookshelf contains all your books in no specific order, or B) your bookshelf contains all books alphabetically sorted by title. Of course, option B) would save you a lot of time – especially if you access your bookshelf multiple times. This article will …

View Post

How to Use Slice Assignment in NumPy?

Real-world data is seldomly clean: It may contain errors because of faulty sensor, or it may contain missing data because of damaged sensors. In this one-liner section, you learn about how to quickly handle smaller cleaning tasks in a single line of code. The Basics Say, you have installed a temperature sensor in your garden to measure temperature data over …

NumPy Cheat Sheet: The Top 5 Tips and Tricks

Cheat sheets are the 80/20 principles for coding: learn 80% of the features in 20% of the time. For my “Coffee Break Python” email subscribers, I create a weekly Python cheat sheet. Currently, NumPy is all over the space, so for the launch of my new book “Coffee Break NumPy“, I have created the following NumPy cheat sheet with a …

View Post

How to use NumPy Boolean Indexing to Uncover Instagram Influencers

This article will give you a practical one-liner solution and teach you how to write concise NumPy code using boolean indexing and broadcasting in NumPy. The Basics NumPy plays an important role in the Python programming language. Not only does it add basic linear algebra functionality to Python, but, with its array data structure, it also provides a better and …

What’s the Best NumPy Book?

Fear of missing out in data science? Data science and machine learning are taking over. Data-driven decision making penetrates every single company nowadays. Data science is indeed the “sexiest job in the 21st century“! There is one Python library which is the basis of any data science related computation you can undertake as a Python coder. The name of this …

View Post

The np.nonzero() Trick: How to Search a NumPy Array

This article explains you how to find array elements using the nonzero() function in NumPy — using a practical data science example. The megatrend urbanization does not come to a halt soon. Cars, factories, and other sources of pollution ultimately lead to poor air quality. This one-liner shows you how to deal with it from a data scientists’ perspective! The …

View Post

3 Little-Known NumPy Tricks in One Line [Python Puzzle]

This one-liner demonstrates the power of three interesting NumPy features and how their combination can solve a small data science problem in a clean and efficient manner. Every NumPy array has a certain data type. Keep this in mind, when exploring the following one-liner code. Although you need to know three different pieces of information to understand the one-liner, you …

View Post

[NumPy Tutorial] How to Calculate Post-Tax Income in One Line?

This article will not only show you how to solve a day-to-day accounting task – which would usually take many lines of Python code – in a single line of code. But it will also introduce you to some elementary functionalities of Python’s wildly important library for numerical computations and data science: NumPy. The Basics At the heart of the …

[Video] 7 Tips to Self-Publish Your First Coding Book

Do you dream of publishing your own book? You are not alone. 80% of adults dream of writing their own book. And in fact, publishing your first coding book can be a great way of boosting your coding career to the next level! For example, thanks to the sales of my “Coffee Break Python” books, I was able to focus …

View Post

NumPy Broadcasting – A Simple Tutorial

It’s how you talk that shows who you are. There is one term that is only known by advanced NumPy coders. If you know the term, consider yourself a NumPy pro. If you don’t, you still have to learn. The term is “broadcasting”. The documentation tells us that broadcasting “describes how NumPy treats arrays with different shapes during arithmetic operations.” …