Author: drweb

I have been working with text data for years, and I keep coming back to the same tool whenever I need to find or transform strings in Python. That tool is the re module. It is one of those things that once you understand, you start seeing opportunities to use it everywhere – parsing logs, validating user input, cleaning up datasets. Throughout this tutorial, I want to show you how to use regular expressions in Python to handle a specific problem: matching strings that satisfy certain conditions. I will walk through the key functions in the re module, and then…

Read More

DevOps.com is now providing a weekly DevOps jobs report through which opportunities for DevOps professionals will be highlighted as part of an effort to better serve our audience. Our goal in these challenging economic times is to make it just that much easier for DevOps professionals to advance their careers. Of course, the pool of available DevOps talent is still relatively constrained, so when one DevOps professional takes on a new role, it tends to create opportunities for others. The ten job postings shared this week are selected based on the company looking to hire, the vertical industry segment and…

Read More

I have used sklearn’s train_test_split more times than I can count. But every now and then I run into a situation where I cannot install sklearn – maybe it is a restricted environment, maybe I am working on a pure NumPy project, or maybe I just want to understand what is happening under the hood. In those moments, I reach for a manual approach. Let me show you exactly how to split data into training and testing sets in plain Python, without sklearn. Manual splitting is not complicated. At its core, you are just dividing a list or array into…

Read More

Building AI agents sounds straightforward until you actually do it. You need an agent to onboard a new employee. It has to create an Entra ID account, provision GitHub access, spin up cloud resources, create tasks in Azure DevOps, and send a welcome message in Teams. Five tools. Five different authentication models. Five different teams are managing those tools. Now multiply that across every agent your organization is building. That’s the problem Microsoft is addressing with Toolboxes in Foundry, now available in public preview. What Toolboxes Actually Do A Toolbox is a named, reusable bundle of tools managed in Microsoft…

Read More

I remember the first time I tried to read a machine learning paper and felt completely lost-not because of the concepts, but because of all the Greek symbols scattered throughout the equations. Pi, Sigma, Alpha, Beta… it felt like a completely different language. If that sounds familiar, you’re in the right place. In this post, I’ll break down every Greek math symbol you’ll encounter in machine learning and explain what each one actually means in plain English. Greek letters show up everywhere in ML-from research papers to library documentation. Rather than trying to memorize them randomly, I think it’s much…

Read More

I keep coming back to the least cost transportation problem when I need to explain optimization to someone. It’s one of those classic linear programming problems that shows up everywhere in supply chain management, and once you see how to solve it in Python, you start noticing it in all sorts of real-world systems. Let me walk you through how I approach this problem. At its core, the least cost transportation problem asks: how do you move goods from multiple factories to multiple distribution centers while spending as little as possible? Each route has a different cost per unit, and…

Read More

I remember the first time I tried to build a Telegram bot. I had a vague idea that it would involve some API and Python, but I kept putting it off because the setup looked complicated. Turns out, it takes about 10 minutes once you know the steps. I am going to walk you through exactly what worked for me. This guide walks you through installing python-telegram-bot, setting up a bot with Telegram’s BotFather, and getting a working bot running on your machine. No fluff, no hand-waving – just the steps that actually work. TLDR Install with pip install python-telegram-bot…

Read More

I keep coming back to the MNIST dataset when I need to quickly test image processing pipelines or validate that a model architecture is actually learning. It is the hello world of machine learning datasets, and after working with it dozens of times I have a workflow that works every time. Let me walk you through exactly how I load and plot the MNIST dataset in Python without running into the common pitfalls. MNIST stands for Modified National Institute of Standards and Technology database. It contains 70,000 square images (28×28 pixels) of handwritten digits from 0 to 9, split into…

Read More

I’ve been working with PyTorch for a while now, and I keep coming back to the same sticking point whenever I start a new project: custom datasets. The built-in datasets are great for learning, but the moment you want to work with your own images, audio files, or any data that doesn’t fit the standard mold, you’re faced with building something from scratch. That’s exactly what I want to walk through in this article. In this tutorial we’ll build custom datasets in PyTorch from the ground up. I’ll show you how to load unlabeled images from a folder, labeled images…

Read More

## TLDR pow(a, n) raises a to the power n – same as a ** n pow(a, n, b) adds modular exponentiation: (a ** n) % b – faster for large numbers The third argument requires a positive exponent – negative exponents with modulus raise a ValueError pow() beats math.pow() for integers – no float conversion, supports modulus, and handles big integers natively Both two-argument and three-argument forms accept any numeric type, including negative exponents and fractions ## How pow() Works in Python ### Two-Argument Form x = pow(2, 5) # 2 raised to the power 5 print(x) # 32…

Read More