|
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 weekA 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, I hope you're having a great September! 🍂 Two quick announcements for you: 1️⃣ I'm working on two mystery courses right now: The first is an ML course, and the second has nothing to do with Data Science! 🤯 Can you guess what the second course is about? 2️⃣ On Monday, I'm raising the price of my Master Machine Learning book from $19 to $29. But until Monday, you can still snag a paperback copy for $19! The ebook will continue to be priced at $19, and you can still read the book...
Hi Reader, A reader asked me the following question: I am now looking towards a new career. Machine Learning is what I've always found very interesting and fascinating. However, I'd like to ask you: Is there really future for this stuff with all the buzz about LLMs becoming more and more capable all the time? Would time be spent well on learning all this stuff? Read this article online Excellent question! As someone who just published a book on Machine Learning, I clearly believe there is...
Hi Reader, the response to my new Machine Learning book has been outstanding! 🤩 My goal with this book is to reach as many people as possible, which is why I’ve made it free to read online as well as keeping the paperback and ebook prices as low as possible. I’m confident it would be an invaluable resource for any Machine Learning bootcamp or course, since it's a highly practical guide as opposed to focusing mostly on theory. Do you have a personal contact at any bootcamp or university where...