python
Python is the engine room of modern data work, and this section focuses on the practical, the surprising, and the genuinely useful. You will find guides on building AI agents with persistent memory and multi-tool reasoning, alongside scripts that automate tedious spreadsheet workflows and recover hidden salary effects from censored data. We cover the math behind Markov chains and expectiles, the mechanics of stateless MCP servers and streaming large JSON files, and the career signals hidden in job postings for forward deployed and AI engineers. Subjects like zeolite crystallization, spectral unmixing, and multi-armed bandit simulations sit next to benchmarks for Python 3.15's JIT compiler and Google's move to the Pyrefly type checker. The recurring names are OpenAI, Ollama, DuckDB, and Marimo; the recurring challenge is turning messy, real-world data into something you can trust. This is Python for people who need answers, not abstractions.

5 Practical Python Scripts to Build Your First AI Agent
Building an AI agent from scratch sounds complex, but five practical Python scripts can get you there. This guide walks through tool use, planning, memory, error recovery, and safety, the core pieces that make an agent actually work. It's a hands-on path to understanding what's happening under the hood, not just theory. If you're also tracking how major platforms approach agent capabilities, our piece on "Amazon and Meta explore new agreement to unlock AI agent Muse" offers useful context on the industry direction.

Build a Bulletproof CSV Loader to Transform Messy Data into Clean Insights
A single malformed CSV file can derail an entire analysis. Building a bulletproof loader around Pandas' `read_csv()` function means handling missing values, inconsistent delimiters, and encoding errors before they become data disasters. This practical guide walks through turning messy input into clean, actionable insights. For a different kind of data challenge, our piece on "When You Need Expectiles Instead of Percentiles for Coverage" explores how asymmetric costs can reshape your statistical assumptions.
How to test any chatbot's vocabulary with a birthday paradox
Run a question 300 times through any chatbot, count how many different answers you get, and the birthday paradox reveals the true size of its vocabulary. The math is simple: a few lines of Python do the work. A small LLM, it turns out, picks from roughly 6 words out of 40. That is a striking constraint for a tool marketed as generative. For a deeper look at what AI can and cannot explain, see our piece on why machine-verified proofs still need human explanation.
OLS Hides Salary Data: Recover Hidden Effects With Tobit Models
A simulated salary survey reveals a hard truth about hidden data: OLS shrinks a $5k-per-year effect to just $3.2k. That's not a modeling failure, it's a structural one, caused by censored observations. This post rebuilds Tobit and truncated likelihoods from scratch to recover the true signal. It's a practical, code-driven guide for anyone who suspects their spreadsheets or regressions are hiding more than they show. For another take on practical modeling, explore what four simple models reveal about bike-share forecasting.
When You Need Expectiles Instead of Percentiles for Coverage
Expectiles cover what percentiles miss. When you target 95% coverage, the 95th percentile and the 0.95 expectile diverge, and that difference matters for asymmetric squared-error costs. The math is exact, and 100 synthetic Python runs confirm it. If you're weighing coverage guarantees against cost penalties, this is where expectiles earn their place. For broader context on how logic grounds AI agents, our piece on the Air Canada chatbot case and Z3 solvers connects nicely.
From Chatbot Errors to Z3 Solvers: How Logic Grounds AI Agents
Air Canada's chatbot promised bereavement fares it couldn't deliver, a costly reminder that language models don't reason. Neurosymbolic agents offer a fix: pair a large language model with a Z3 solver for guaranteed logical consistency. The solver is sound, but the English-to-logic translation remains fragile. This practical walkthrough shows how to build that pipeline in Python. For a deeper look at structured reasoning, see our piece on how a herder agent prioritizes questions by urgency.
Model Markov Chains in Python with NumPy for Smarter Data Workflows
A three-state writing workflow, drafting, revising, and publishing, makes an ideal test case for understanding Markov chains. This guide walks through transition matrices, the Chapman, Kolmogorov equation, and stationary distributions using NumPy, turning abstract probability into practical Python. The approach is direct and instructive, not theoretical. For a different angle on mathematical clarity, our video "Explore embeddings through the geometry of cosine similarity explained simply" shows how dot products reveal structure in vector space. Both pieces share a commitment to making complex ideas feel manageable.
Running local LLMs from Python with Apple's fm CLI
Running local LLMs from Python with Apple's fm CLI is a clever experiment, but a Sate Padang vision test and a Malaysia capital question reveal why free, private models still need grounding before they leave prototyping. The promise of on-device inference is real; the accuracy is not yet trustworthy without validation. For more on why agentic projects often stumble before they scale, see our related piece on why most fail before they start.

Automate the tedious with beginner-friendly Python scripts that simplify daily tasks
Repetitive tasks don't have to consume your day. Beginner-friendly Python scripts can handle the tedious work, organizing files, processing images, and simplifying daily workflows, so you can focus on what actually matters. This approach makes automation accessible, not intimidating. If you're ready to go deeper, our guide on building multi-agent AI tools for EV purchases shows how Python scales from simple scripts to sophisticated systems. Start with the basics, then explore what's possible.
Explore multi-agent AI design by building EV purchase and support tools
Multi-agent AI design doesn't have to be abstract. Build an EV purchase adviser and a support agent in Python, then watch how fan-out, pipelines, hierarchies, and swarms reuse the same building blocks. It's a practical way to explore how these systems scale. For deeper context on tracking such investments, our piece on "12 KPIs to Track AI Adoption, Cost, and Performance in Your Organization" offers a grounded framework. Start building, and discover how these patterns transform what's possible.

Explore Python Libraries That Make Time Series Analysis More Accessible
Time series analysis doesn't have to be a wall of math. These Python libraries turn forecasting, deep learning, and anomaly detection into accessible tools you can actually use. They meet you where you are, whether you're cleaning timestamps or building predictive models. If you want to see how structured, repeatable workflows amplify this approach, our guide on building persistent memory for your AI agent with a single JSON file offers a practical companion.
Design an AI Agent That Picks Its Own Tools and Knows When to Stop
Eight turns. That's the circuit-breaker in this design: an AI agent that picks its own database tools, uses each result to inform its next call, and knows when to stop. It's a practical approach to building autonomous systems that don't spin forever. For those exploring similar patterns, our guide on 12 KPIs to Track AI Adoption, Cost, and Performance offers concrete metrics for measuring what these agents actually deliver. This is controlled agency, intentional, measurable, and refreshingly grounded.
Build Persistent Memory for Your AI Agent with a Single JSON File
A single JSON file can now give your Python AI agent memory that survives a restart. Three Python classes, an OpenRouter key, and gpt-4.1-mini equip the agent with a calculator, a stub web search, and full conversation recall. This is a practical step toward agents that actually remember context between sessions. If you're building autonomous tools, this approach removes a major friction point. For deeper context on keeping agents both capable and secure, see our coverage of Edera's Object Capability Bounded Authority model.

Explore 7,000 pages in minutes with Python and Olostep's batch API
Seven thousand pages in minutes. That's the kind of throughput that changes how you think about data collection. Olostep's Batch API lets you scrape thousands of pages, download clean Markdown, and measure exactly what finished, no guesswork, no manual babysitting. Python handles the orchestration; Olostep handles the speed. If you're ready to move beyond copy-paste workflows, this is the tool that makes large-scale scraping feel accessible. For more on automation governance, see our coverage of Leapwork Play.
Discover smarter workflows from the week's top Excel community insights
The community is speaking clearly this week: Power Query and PivotTables dominate the conversation, while the old mouse-versus-keyboard debate rages on. The top post offers a practical, headache-saving order for getting started with Power Query, a welcome guide for anyone feeling lost in data preparation. If you're still wrestling with mixed date formats, our related article on taming them with a repeatable cleaning process offers a natural next step.
Separating Shot Selection from Shot Making with Python
Field-goal percentage tells you how often a player makes a shot, but it says nothing about how hard those shots were. That gap matters, and Python plus machine learning can help close it by separating shot selection from shot making. If you're feeling constrained by traditional spreadsheets, this is the kind of question worth exploring. For a broader look at practical machine learning work, "Navigating Aggressive Crops and Moderate Zooms in Augmented Datasets" offers useful perspective.

Discover the AI skills employers demand today and what they mean for your career
AI skills are reshaping job postings, and the data is clear: employers want people who can work *with* AI, not just talk about it. From prompt engineering to model fine-tuning, these aren't niche buzzwords, they're practical tools for getting work done. For your career, this means adaptability matters more than ever. If you're curious about building foundational skills, our piece on "Three Primitives to Build Your Future with Harness Engineering" offers a natural next step.

Two Data Roles, One Skillset, Very Different Workdays
Python, APIs, cloud deployment, these skills appear in both forward deployed engineer and AI engineer job descriptions, yet the two roles lead to very different workdays. An FDE might spend the morning tracing a customer's approval process before writing an integration, while a product AI engineer investigates why a model behaves unexpectedly. It's a reminder that identical technical foundations can shape entirely distinct careers. For more on practical AI skills, see our coverage of putting GPT-6.1 Terra's capabilities to the test.
Create Your First AI Agent in Python With OpenAI's SDK
Building your first AI agent in Python doesn't require a massive infrastructure play. OpenAI's SDK makes it surprisingly straightforward: you add web search, Python tools, conversation memory, and tracing into a single end-to-end workflow. This is the kind of practical, action-oriented guide that shows how accessible agent-driven data work can be. For more patterns that sharpen your approach, our piece on "Seven Python Patterns That Sharpen Data Science Code" complements this workflow nicely.

Seven Python Patterns That Sharpen Data Science Code
Seven design patterns, Strategy, Adapter, Command, Proxy, each mapped to the pressure it solves, the Python shape it takes, and the caveat that keeps it honest. This isn't abstract theory. It's practical architecture for data science code that needs to scale without breaking. If you've already seen how Python 3.15's new profiler uncovers hidden bottlenecks, this is the natural next step: patterns that turn those insights into resilient, maintainable workflows.

A 40% Speed Gain: How AI Optimized a Developer Toolkit Overnight
An 11-hour unattended run of Gemini 4 Argon produced two accepted optimizations for Google Agent Development Kit, shaving roughly 40% off in-memory session-preparation overhead in long sessions and cutting cold package import time by 21%. That's a meaningful overnight gain for developers who feel the drag of traditional setup. For a deeper look at how Google is shaping agent workflows, our coverage of Data Agent Kit's general availability complements this story well.
From Field Reports to Clean Data: Automating Your Spreadsheet Workflow
An intern at an electrical company built the logic to flag procedural errors in field reports, now they need the system to close the loop. The goal is elegant: group errors by worker, send one summarized email per person, collect their written justifications, and auto-update the master file. Python is the smartest path here. It handles email automation, data parsing, and API calls more reliably than VBA.

Your AI team works through the night so you wake to a finished newsletter
Three AI employees worked through the night so you didn't have to. By Friday at 8 a.m., your weekly tech newsletter is drafted, fact-checked, and waiting for a single click. A researcher found the best links. A writer turned them into prose. An editor caught a fabricated statistic, fixed it, and finished the job. You were asleep. This isn't a fantasy, it's a Python-powered workflow you can build today.
Track zeolite crystallization with a practical Python tutorial on spectral unmixing
Zeolite crystallization is notoriously hard to track in real time. This tutorial shows you how to do it with spectral unmixing and real in situ data, using Python from start to finish. The approach is practical and reproducible, no black boxes, just non-negative least squares modelling applied to Raman spectra. If your spreadsheet memory keeps spiking on large data loads, you might also appreciate why streaming solves that problem.