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 PythonIf 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! |
Join 25,000+ intelligent readers and receive AI tips every Tuesday!
Hi Reader, On Friday, I announced my forthcoming book, Master Machine Learning with scikit-learn. In response, my Dad asked me: How does the subject of this book relate to Artificial Intelligence? In other words: What's the difference between AI and Machine Learning? Ponder that question for a minute, then keep reading to find out how I answered my Dad... π AI vs Machine Learning Here's what I told my Dad: You can think of AI as a field dedicated to creating intelligent systems, and Machine...
Hi Reader, Yesterday, I posted this announcement on LinkedIn and Bluesky and X: Kevin Markham @justmarkham Dream unlocked: I'm publishing my first book! πππ It's called "Master Machine Learning with scikit-learn: A Practical Guide to Building Better Models with Python" Download the first 3 chapters right now: π https://dataschool.kit.com/mlbook π Thanks for your support π 1:47 PM β’ Sep 11, 2025 1 Retweets 5 Likes Read 1 replies This has been a dream of mine for many years, and I'm so excited...
Hi Reader, Hope youβve had a nice summer! βοΈ As for me, Iβve been finishing my first ever book! I canβt wait to tell you about it and invite you to be part of the launchβ¦ stay tuned π Today's email focuses on a single important topic: AIβs impact on your mental health π§ Read more below! π Sponsored by: Morning Brew The 5-Minute Newsletter That Makes Business Make Sense Business news doesn't have to be dry. Morning Brew gives you the biggest stories in business, tech, and finance with quick...