Vibe coding is fun: You can go from an idea to a working app in a weekend. But if you don’t have a background in software, how can you be sure your app is secure? Tested? Backed up? Ready for real customers, or for an investor’s technical review? Today I’m launching Vibe to Valid, an…
Want to set an option in Python Pandas, but just temporarily? You can use option_context: Within the “with” block, the display precision is 2. But outside — before or after — it is the default.
There are tons of config options in Python Pandas. Set them with pd.set_option: Now floats in a series or data frame will have 2 digits after the decimal. Retrieve the value with “get_option”:
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 faster, taking 252 ms. However, it’s still far slower than PyArrow, which took 25.5 ms.
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 ways, this is the course for you. I’ve distilled what I’ve learned from using Claude Code every day for about a year to run my…
Starting with Python Pandas 3.1, use “filter” to apply a condition to rows. So: can now be (the much slower):
Want to retrieve specific columns from your Python Pandas data frame? In the past, you would say But now, with version 3.1, you can use the “select” method:
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, but cannot run str on each. For that, we still need a nested comprehension.
In Python 3.15, get the unique elements in a list of iterables with the new in-comprehension unpacking syntax to create a set comprehension: {*n for n in x} # returns {10, 20, 30, 40, 50, 60}
Want to unroll a nested list in Python 3.15? Use a nested list comprehension: Or use the new unpacking syntax: [*n for n in x] # same thing!