The Real Python Podcast

Exploring the functools Module and Complex Numbers in Python


Listen Later

Are you ready to expand your Python knowledge into the intermediate to advanced territory? What tools are awaiting your discovery inside Python’s functools module? This week on the show, David Amos is back, and he’s brought another batch of PyCoder’s Weekly articles and projects.

We discuss an article about the functools module, which adds functionality for caching, function overloading, better definitions for decorated functions, and more. David talks about a new Real Python article about working with complex numbers in Python. We also cover a tutorial about troubleshooting memory problems in Python.

We cover several other articles and projects from the Python community including, DevOps interview questions, correlation analysis in Python, pivot and plot data with pandas, how to use Python and OpenCV to play online chess with a real chessboard, and generating hardware pinout diagrams as SVG images.

Course Spotlight: Python Decorators 101

In this course on Python decorators, you’ll learn what they are and how to create and use them. Decorators provide a simple syntax for calling higher-order functions in Python. By definition, a decorator is a function that takes another function and extends the behavior of the latter function without explicitly modifying it.

Topics:

  • 00:00:00 – Introduction
  • 00:01:56 – The Future of FastAPI and Pydantic Is Bright
  • 00:04:33 – Simplify Complex Numbers With Python
  • 00:10:37 – Functools: The Power of Higher-Order Functions in Python
  • 00:18:40 – Sponsor: Sentry
  • 00:19:42 – How to Pivot and Plot Data With Pandas
  • 00:23:06 – devops-exercises: DevOps Interview Questions
  • 00:32:09 – Video Course Spotlight
  • 00:33:25 – Correlation Analysis 101 in Python
  • 00:39:28 – How to Troubleshoot Memory Problems in Python
  • 00:46:16 – Use Python and OpenCV to Play Online Chess With a Real Chessboard
  • 00:49:28 – pinout: Generate Hardware Pinout Diagrams as SVG Images
  • 00:54:21 – Thanks and goodbyes
  • Show Links:

    The Future of FastAPI and Pydantic Is Bright – Not long ago there was some chatter on the internet about a change in Python 3.10 that would impact Python projects that check types at runtime. The discussion centered around FastAPI and Pydantic and had some folks worried about the future of those projects. In this article, FastAPI’s creator explains what the discussion was all about and why the future of FastAPI and Pydantic remains bright.

    Simplify Complex Numbers With Python – In this tutorial, you’ll learn about the unique treatment of complex numbers in Python. Complex numbers are a convenient tool for solving scientific and engineering problems. You’ll experience the elegance of using complex numbers in Python with several hands-on examples.

    Functools: The Power of Higher-Order Functions in Python – The functools module is one of the “hidden gems” of the Python standard library. This article takes you on a tour of everything in functools. You’ll learn how to implement caching, function overloading, and a whole lot more.

    How to Pivot and Plot Data With Pandas – One of the challenges of working with data is knowing how to manipulate the data format for a particular analysis. And there’s no single correct format. You need to know how to melt, pivot, and transpose data into a format that fits whatever you’re analyzing. If you enjoy this article, be sure to also check out Stefanie’s Pandas Workshop.

    devops-exercises: DevOps Interview Questions

    Correlation Analysis 101 in Python – Correlation analysis is a useful part of exploratory data analysis. It can help you identify potential relationships between various features of your data. In this helpful guide, you’ll learn how to do correlation analysis in a pandas DataFrame. You’ll see how to display a correlation matrix as a heatmap and explore some guidelines for identifying when correlation might imply causation.

    How to Troubleshoot Memory Problems in Python – Memory problems can be frustrating. They’re hard to diagnose and fix, and memory issues in Python applications can be especially frustrating thanks to the language’s garbage collection system. In this article, you’ll learn a six-step process for troubleshooting memory problems that the EvalML team used to solve a tricky problem with their library.

    Projects:

    • play-online-chess-with-real-chess-board: Use Python and OpenCV to Play Online Chess With a Real Chessboard
    • pinout: Generate Hardware Pinout Diagrams as SVG Images
    • Additional Links:

      • functools: Python 3 Documentation
      • Primer on Python Decorators: Real Python Guide
      • Caching in Python Using the LRU Cache Strategy: Real Python Article
      • Caching in Python With lru_cache: Real Python Video Course
      • Measuring Memory Usage in Python: It’s Tricky!
      • Fritzing: Electronics Made Easy
      • KiCad EDA: A Cross Platform and Open Source Electronics Design Automation Suite
      • PcbDraw: Convert your KiCAD boards into nice looking 2D drawings
      • Four stages of competence: Wikipedia article
      • Level up your Python skills with our expert-led courses:

        • Python Decorators 101
        • Python Inner Functions
        • Plot With pandas: Python Data Visualization Basics
        • Support the podcast & join our community of Pythonistas

          ...more
          View all episodesView all episodes
          Download on the App Store

          The Real Python PodcastBy Real Python

          • 4.7
          • 4.7
          • 4.7
          • 4.7
          • 4.7

          4.7

          139 ratings


          More shows like The Real Python Podcast

          View all
          Software Engineering Radio by se-radio@computer.org

          Software Engineering Radio

          271 Listeners

          The Changelog: Software Development, Open Source by Changelog Media

          The Changelog: Software Development, Open Source

          289 Listeners

          Software Engineering Daily by Software Engineering Daily

          Software Engineering Daily

          624 Listeners

          Talk Python To Me by Michael Kennedy

          Talk Python To Me

          585 Listeners

          Soft Skills Engineering by Jamison Dance and Dave Smith

          Soft Skills Engineering

          288 Listeners

          Super Data Science: ML & AI Podcast with Jon Krohn by Jon Krohn

          Super Data Science: ML & AI Podcast with Jon Krohn

          302 Listeners

          Python Bytes by Michael Kennedy and Brian Okken

          Python Bytes

          215 Listeners

          Syntax - Tasty Web Development Treats by Wes Bos & Scott Tolinski - Full Stack JavaScript Web Developers

          Syntax - Tasty Web Development Treats

          987 Listeners

          REWORK by 37signals

          REWORK

          210 Listeners

          CoRecursive: Coding Stories by Adam Gordon Bell - Software Developer

          CoRecursive: Coding Stories

          190 Listeners

          DataFramed by DataCamp

          DataFramed

          269 Listeners

          Practical AI by Practical AI LLC

          Practical AI

          210 Listeners

          AWS Podcast by Amazon Web Services

          AWS Podcast

          203 Listeners

          The Stack Overflow Podcast by The Stack Overflow Podcast

          The Stack Overflow Podcast

          64 Listeners

          The Pragmatic Engineer by Gergely Orosz

          The Pragmatic Engineer

          64 Listeners