Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Filter by Categories
About Article
Analyze Data
Archive
Best Practices
Better Outputs
Blog
Code Optimization
Code Quality
Command Line
Course
Daily tips
Dashboard
Data Analysis & Manipulation
Data Engineer
Data Visualization
DataFrame
Delta Lake
DevOps
DuckDB
Environment Management
Feature Engineer
Git
Jupyter Notebook
LLM
LLM Tools
Machine Learning
Machine Learning & AI
Machine Learning Tools
Manage Data
MLOps
Natural Language Processing
Newsletter Archive
NumPy
Pandas
Polars
PySpark
Python Helpers
Python Tips
Python Utilities
Scrape Data
SQL
Testing
Time Series
Tools
Visualization
Visualization & Reporting
Workflow & Automation
Workflow Automation

Newsletter #285: Narwhals: One Function for pandas, Polars, and DuckDB

Newsletter #285: Narwhals: One Function for pandas, Polars, and DuckDB

Grab your coffee. Here are this week’s highlights.


๐Ÿ“… Today’s Picks

Narwhals: One Function for pandas, Polars, and DuckDB

Code example: Narwhals: One Function for pandas, Polars, and DuckDB

Problem

Teams today use multiple DataFrame libraries side by side. Each backend has its own syntax, so your utility functions end up full of if/elif chains checking types.

This makes even small logic changes expensive, since every backend implementation must be updated.

Solution

Narwhals removes this complexity by providing a unified DataFrame API.

How it works:

  • Wrap any DataFrame with nw.from_native() (pandas, Polars, DuckDB, PySpark, PyArrow)
  • Write transformations once using Polars-style operations
  • Convert back to the original type with nw.to_native()
  • Zero extra dependencies. Each backend keeps its native performance

uv: Switch Python Versions Without Rebuilding Environments

Code example: uv: Switch Python Versions Without Rebuilding Environments

Problem

Switching Python versions typically requires recreating virtual environments and reinstalling all dependencies from scratch.

This workflow wastes time and can introduce version conflicts when dependencies need to be resolved again.

Solution

UV allows seamless Python version upgrades with uv python pin while preserving existing dependencies.

The process is simple:

  • Pin the version with uv python pin 3.x
  • Sync dependencies with uv sync
  • All cached packages are preserved automatically

โ˜•๏ธ Weekly Finds

Airbyte [Data Engineering] – Data integration platform with 600+ connectors for ETL/ELT pipelines from APIs, databases, and files to warehouses and lakes

act [DevOps] – Run GitHub Actions locally for fast feedback without commit/push cycles, using Docker containers

Dash [AI Agents] – Self-learning text-to-SQL agent that grounds answers in six layers of context and improves automatically from failures

Looking for a specific tool? Explore 70+ Python tools โ†’

๐Ÿ“š Latest Deep Dives

5 Python Tools for Structured LLM Outputs: A Practical Comparison – Compare 5 Python tools for structured LLM outputs. Learn when to use Instructor, PydanticAI, LangChain, Outlines, or Guidance for JSON extraction.


Stay Current with CodeCut

Actionable Python tips, curated for busy data pros. Skim in under 2 minutes, three times a week.

Leave a Comment

Your email address will not be published. Required fields are marked *

0
    0
    Your Cart
    Your cart is empty
    Scroll to Top

    Work with Khuyen Tran

    Work with Khuyen Tran