AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
Array Logic: Embrace the Mask
True and false values in NumPy are derived from comparisons that generate Boolean arrays, often referred to as masks. When evaluating conditions, operators like '<' return these Boolean arrays, facilitating multi-condition evaluations. Combining conditions requires using the bitwise 'and' operator ('&') instead of the typical 'and' keyword, a necessity due to Python's limitations in overloading it. This design choice enhances coding efficiency, reducing the amount of typing required.
Should you use a Python virtual environment in a Docker container? What are the advantages of using the same development practices locally and inside a container? Christopher Trudeau is back on the show this week, bringing another batch of PyCoder’s Weekly articles and projects.
We share a recent post by Hynek Schlawack about building Python projects using Docker containers. Hynek argues for using virtual environments for these projects, like developing a local one. He’s found that keeping your code in an isolated, well-defined location and structure avoids confusion and complexity.
We also discuss our development setups, including Python versions, code editors, virtual environment practices, terminals, and customizations. We dig into how your programming history affects the tools you use.
We share several other articles and projects from the Python community, including a group of new releases, addressing the “why” in comments, comparing a data science workflow in Python and R, removing common problems from CSV files, and a project for creating HTML tables in Django.
This episode is sponsored by InfluxData.
Course Spotlight: Advanced Python import Techniques
The Python import system is as powerful as it is useful. In this in-depth video course, you’ll learn how to harness this power to improve the structure and maintainability of your code.
Topics:
where()
News:
Show Links:
where()
– This tutorial teaches you how to use the where() function to select elements from your NumPy arrays based on a condition. You’ll learn how to perform various operations on those elements and even replace them with elements from a separate array or arrays.Discussion:
Projects:
Additional Links:
Level up your Python skills with our expert-led courses:
Listen to all your favourite podcasts with AI-powered features
Listen to the best highlights from the podcasts you love and dive into the full episode
Hear something you like? Tap your headphones to save it with AI-generated key takeaways
Send highlights to Twitter, WhatsApp or export them to Notion, Readwise & more
Listen to all your favourite podcasts with AI-powered features
Listen to the best highlights from the podcasts you love and dive into the full episode