x = 43; x += 1; print(f"Tuesday Tip #{x}")


Hi Reader, happy Tuesday!

My recent tips have been rather lengthy, so I'm going to mix it up with some shorter tips (like today's). Let me know what you think! πŸ’¬


πŸ”— Link of the week

​A stealth attack came close to compromising the world's computers (The Economist)

If you haven't heard about the recent "xz Utils backdoor", it's an absolutely fascinating/terrifying story! In short, a hacker (or team of hackers) spent years gaining the trust of an open-source project by making helpful contributions, which eventually allowed them to smuggle a sophisticated, hidden exploit into the code.

Had a single developer at Microsoft not discovered the problem (in his spare time!), hackers would soon have gained secret access to hundreds of millions of computers, allowing them to steal private data from banks, governments, and more.

For more technical details, see this article from Ars Technica.


πŸ‘‰ Tip #44: Augmented assignment in Python

If you're new to Python (or programming in general), you might be confused by code like this:

x += 1

As long as x is a number, that code translates to:

x = x + 1

In other words, it's a concise way to increment the value of x by 1.

This is known as "augmented assignment," and there are actually a dozen other augmented assignment operators in Python. Here are the most common ones:

x -= 3 (translates to x = x - 3)

x *= 4 (translates to x = x * 4)

x /= 2 (translates to x = x / 2)

Under the hood, these statements call dunder methods such as __iadd__, __isub__, and so on, which means that their behaviors can be customized for different types of objects.

In case you're curious, the "i" in __iadd__ stands for "in-place" because it mutates the original object. As such, you may notice an unexpected behavior if you try to use these operations with Python lists.


πŸ‘‹ See you next Tuesday!

Did you like this week’s tip? Please forward it to a friend or share this link with your favorite online community. It really helps me out!

- Kevin

P.S. xkcd comes true (a reference to the link of the week)

Did someone AWESOME forward you this email? Sign up here to receive Data Science tips every week!

Learn Artificial Intelligence from Data School πŸ€–

Join 25,000+ intelligent readers and receive AI tips every Tuesday!

Read more from Learn Artificial Intelligence from Data School πŸ€–

Hi Reader, I'm thrilled to announce that my new book, Master Machine Learning with scikit-learn, is now on sale! Buy from Amazon I poured my heart and soul into making this the highest quality and most practical Machine Learning book available. Publishing this book is a dream come true, and I'd be grateful if you'd consider picking up a copy! πŸ™ Option 1: Get the paperback from Amazon ($19) Although most technical books of this size (300+ pages) tend to sell for at least $39, I've priced the...

Hi Reader, A few months ago, I announced that my new book, Master Machine Learning with scikit-learn, would be published in December. Since then, my personal life has undergone some dramatic changes πŸ₯΄ During the transition, it has been challenging to focus on anything other than bare life essentials 🍽️ πŸ›Œ 🚿 Thankfully, my life has begun to steady (yay!), and so in the past few weeks I've been able to wrap up some key pieces of the project! βœ… I'm thrilled to hold in my hands the FINAL proof...

Hi Reader, happy new year! πŸŽ‰ I wanted to share with you the three most important articles I found that look back at AI progress in 2025 and look forward at what is coming in 2026 and beyond. I’ve extracted the key points from each article, but if you have the time and interest, I’d encourage you to read the full articles! πŸ’  The Shape of AI: Jaggedness, Bottlenecks and Salients By Ethan Mollick β€œJaggedness” describes the uneven abilities of AI: It’s superhuman in some areas and far below human...