Breaking out of nested loops with generators, Build a search index in Python and more
Here’s Why You Probably Don’t Need Langchain, Advanced Pandas: 21 Powerful Tips for Efficient Data Manipulation with some more interesting news, articles, packages and projects
News
Mypy 1.11 Released
Some of the highlights are Support Python 3.12 Syntax for Generics (PEP 695), Support for functools.partial, Stricter Checks for Untyped Overrides.
Pytest 8.3.0 Released
python-oracledb 2.3.0 Released
Articles
Breaking out of nested loops with generators
When searching for something using a loop, we typically break once we find it. However, in nested loops, this approach can become messy. Rodrigo demonstrated a cleaner way to handle this scenario using `yield`.
# Rodrigo
Here’s Why You Probably Don’t Need Langchain!
For a simple GenAI application, there is no need for fancy tools like LangChain or LlamaIndex. Sticking to the KISS (Keep it Simple, Stupid) principle is often the best approach. Om Kamath demonstrated this with an amazing example project: Chat with your CSV files
# Om Kamath
Advanced Pandas: 21 Powerful Tips for Efficient Data Manipulation
Pandas is the go-to choice for many people when it comes to handling structured data, from data cleaning to complex analysis. It offers a wide range of functionalities. In this article, Fares Sayah shared some of those functionalities like printing DataFrame in Markdown-friendly format, explode(), etc.
# Fares Sayah
Build a search index in Python
How can search engines search for what we are looking for so quickly? One of the key concepts behind this is the “inverted index”. In this article, James explained the inverted index concept with a nice & simple example, providing a basic understanding of how it works.
# James
From 0 to Senior in Python: Recursive functions under the hood
Olof Baage provided an amazing explanation of the recursive function concept with an example in this article. It's one of the best explanations of recursive functions I've ever read.
# Olof Baage
Python Logging: From Basics to Advanced Practices
Logging is essential for all applications as it allows us to track events, debug problems and understand application behaviour. Every developer should have a solid understanding of logging. We can begin our logging journey with Python's built-in `logging` module, which meets most of our needs. For more advanced requirements, there are excellent packages like structlog and loguru. In this article, Moraneus provided a detailed explanation of it with good examples.
# Moraneus
Manage Python dependencies with pip-tools
Many Python developers aren't fond of the default method for managing dependencies in a Python project. Maybe because of that a lot of options have come to the Python world like poetry, pdm, rye, pip-tools, etc. In this tutorial, Gourav Goyat showed how to use pip-tools for managing dependencies in a Python project.
# Gourav Goyat
Interesting Packages and Projects to explore
functime - Time-series machine learning at scale. Built with Polars for embarrassingly parallel feature extraction and forecasts on panel data.
Diagrams - 🎨 Diagram as Code for prototyping cloud system architectures.
PyWebIO - Write interactive web app in a script way
typeguard - Run-time type checker for Python
Nikola - A static website and blog generator
About Upcoming Python Events
PyOhio 2024
July 27-28, 2024
Lightning Talks - PythonHo User Group Ho
July 27, 2024
Canberra Python meetup
August 1, 2024
Django Girls Ecuador 2024
August 3, 2024