560 blogs tracked7,114 posts indexed

#python

50 posts · 6 companies · newest first

Curated view of this subject:Topic: Python512
1

Do programmers have a future? (opens on the source site)

The short answer: Yes, absolutely. For several decades now, a degree in computer science (or related field) has almost guaranteed employment, with good salaries, excellent benefits, and comfortable working conditions. […] The post Do programmers have a future? appeared first on LernerPython.

aipythonexcerpt only · body stays at the source 11 comment on HN (opens the discussion)
From the web
4

Python tracebacks with Rich: Colorized output and local variables (opens on the source site)

Want your Python traceback to look nice? Use Rich: Now your tracebacks will be colorized and highlighted, with local variables clearly displayed and set apart (thanks to show_locals=True). The post Python tracebacks with Rich: Colorized output and local variables appeared first on LernerPython.

pythonexcerpt only · body stays at the source
From the web
10

I released Cloud-Native Environment Agency DEM data! (opens on the source site)

At the FOSS4G UK 2026 conference in October, I gave a talk announcing that I’d re-released the Environment Agency DEM data for England in cloud-native formats. This was covering some work I did for my client Rebalance Earth and that we’ve decided to release openly. If you already know what I’m talking about then you […]

academicgisexcerpt only · body stays at the source
From the web
13

Pandas 3.1 CSV loading: Multi-threaded, but PyArrow is still faster (opens on the source site)

Reading a CSV into a Python Pandas data frame? Before version 3.1, loading CSV was single-threaded and slow. My test file took 1.03s. In 3.1, it’s now multi-threaded and much […] The post Pandas 3.1 CSV loading: Multi-threaded, but PyArrow is still faster appeared first on LernerPython.

pythonexcerpt only · body stays at the source
From the web
14

New course: Introduction to agentic coding with Claude Code (opens on the source site)

I’m excited to announce my newest course, Introduction to agentic coding with Claude Code (https://lernerpython.com/courses/intro-agentic-coding-claude-code/). If you want to go beyond giving simple prompts or using Claude Code in trivial […] The post New course: Introduction to agentic coding with Claude Code appeared first on LernerPython.

pythonexcerpt only · body stays at the source
From the web
17

Python 3.15 comprehension unpacking: Why you can’t transform items (opens on the source site)

The comprehension-unpacking syntax in Python 3.15 is great, but you cannot transform the unpacked elements. Given: [[10, 20, 30], [40, 50, 60], [70, 80]] We can get the individual numbers, […] The post Python 3.15 comprehension unpacking: Why you can’t transform items appeared first on LernerPython.

pythonexcerpt only · body stays at the source
From the web
20

AI is programming’s next abstraction. What should we teach? (opens on the source site)

Programming has climbed from soldered wires to assembly to Python, and each new layer of abstraction has let more people solve bigger problems. AI coding is the next layer, and it changes what we should teach. The post AI is programming’s next abstraction. What should we teach? appeared first on LernerPython.

pythontrainingexcerpt only · body stays at the source 35 comments on HN (opens the discussion)
From the web
21

Pandas multi-index: Working with 3D data using `.loc` and `.xs` (opens on the source site)

My students used to ask if Python Pandas supports 3D data structures. Answer: No. Series are 1D and data frames are 2D. But… a multi-index effectively gives you more dimensions. […] The post Pandas multi-index: Working with 3D data using `.loc` and `.xs` appeared first on LernerPython.

pythonexcerpt only · body stays at the source
From the web
27

Pandas offset aliases for resample: ME, MS, and other codes (opens on the source site)

Using resample in Python Pandas? You’ll want a list of “offset aliases,” the codes that let you specify units. Some are surprising, such as “ME” and “MS” for “month end” […] The post Pandas offset aliases for resample: ME, MS, and other codes appeared first on LernerPython.

pythonexcerpt only · body stays at the source
From the web
29

Pandas DatetimeIndex slicing: Fix KeyError with sort_index (opens on the source site)

Slice an unsorted datetime index in Python Pandas, and you’ll likely get: KeyError: ‘Value based partial slicing on non-monotonic DatetimeIndexes with non-existing keys is not allowed.’ Why? If the dates […] The post Pandas DatetimeIndex slicing: Fix KeyError with sort_index appeared first on LernerPython.

pythonexcerpt only · body stays at the source
From the web
31

AI infrastructure on tap with the Pulumi AICR provider (opens on the source site)

Recently, some members of the Pulumi team spent time in San Francisco attending the CoreWeave: Fully Connected 2026 conference, where we had a chance to talk to everyone from solo developers to engineering leaders at Fortune 500 organizations and learn more about how they are building with AI. A frequent topic of conversation was open weight models and self-hosted inference. Whether AI is integrated into your platform, your product, or your productivity pipelines, rising token costs have decision makers everywhere giving open weight models a closer look, in exchange for the promise of tighter…

aikubernetesexcerpt only · body stays at the source
From the web
35

Pandas groupby: Aggregating multiple columns with multiple functions (opens on the source site)

Does Python Pandas allow multiple data columns and multiple methods? Yes! The above returns a data frame. Its 4 columns are a 2-level multi-index with mean/std in the inner level. The post Pandas groupby: Aggregating multiple columns with multiple functions appeared first on LernerPython.

pythonexcerpt only · body stays at the source
From the web
36

Pandas groupby: Multiple columns and multiple aggregation methods (opens on the source site)

Does Python Pandas allow multiple categorical columns and multiple methods? Yes! The above returns: – A 2-column data frame (mean + std)– A 2-level index (passenger_count + VendorID) The post Pandas groupby: Multiple columns and multiple aggregation methods appeared first on LernerPython.

pythonexcerpt only · body stays at the source
From the web
38

Monte-Carlo simulations (opens on the source site)

Monte Carlo simulations (or methods) is the technique of applying randomness and the Law of large numbers to the solution of various scientific and engineering problems. One of its first documented uses was by Stanislaw Ulam and John von Neumann for nuclear weapon simulations after WWII [1]. In this post I want to provide examples of some simple uses of Monte Carlo simulations. We'll start with the classical example of calculating the value of \pi by throwing darts. Estimating pi Suppose we take a square board and inscribe a quarter of a circle into it. We then proceed to throw darts at the…

miscmathexcerpt only · body stays at the source 18140 comments on HN (opens the discussion)
From the web
40

Pandas groupby with sort=False: Keep groups in order of appearance (opens on the source site)

A “groupby” call in Python Pandas is normally sorted by index. But if you’re grouping by month name, April will come before January. Pass “sort=False”, and the index will reflect […] The post Pandas groupby with sort=False: Keep groups in order of appearance appeared first on LernerPython.

pythonexcerpt only · body stays at the source
From the web
42

Building Kubernetes PR Previews with Shared Pulumi Components (opens on the source site)

My team develops a microservices application on Kubernetes, with hundreds of PRs opened each day. To let engineers test and review those changes in isolation before they’re merged, we give every pull request its own ephemeral environment. We use Pulumi to define those short-lived PR environments from a component resource that’s shared with our long-lived Dev, Stage, Prod environments. Each PR gets its own Pulumi stack and Kubernetes namespace, which we tear down once the PR is merged or closed. In this post, I’ll walk through how we’ve implemented this pattern and what we’ve learned from…

pulumikubernetesexcerpt only · body stays at the source
From the web
43

Pandas dropna with thresh: Drop only rows with too many NaN values (opens on the source site)

You can remove NaN from a Python Pandas data frame with dropna, but be careful: It removes rows with even one NaN, which can be overkill. Pass “thresh” to allow […] The post Pandas dropna with thresh: Drop only rows with too many NaN values appeared first on LernerPython.

pythonexcerpt only · body stays at the source
From the web
45

New on the LernerPython practice system: A visual debugger (opens on the source site)

I’m a big fan of exercises, which is why the LernerPython platform includes hundreds of them — all using my in-browser practice system, which handles Python, Pandas, and Git, along […] The post New on the LernerPython practice system: A visual debugger appeared first on LernerPython.

pythonexcerpt only · body stays at the source
From the web
48

Python Workers are now generally available (opens on the source site)

Python Workers allow developers to run Python web frameworks and AI orchestration libraries natively in the Cloudflare Workers runtime. You can seamlessly integrate with Cloudflare's ecosystem including D1, R2, and Workers AI without writing any JavaScript glue code.

aideveloper-platformexcerpt only · body stays at the source 27044 comments on HN (opens the discussion)
From the web
50 shown

Privacy choices

Reading never requires analytics. These choices last 90 days on this browser.

Essential sign-in and security storage always stays on. Read the privacy notice.