I used Python Pandas to total AWS S3 payments. Data was in a CSV file. But numbers in the “Amount” column were written as “USD 12.34”. Here’s what I did:
Python gotcha: Forgetting () on method calls! Result: Error: ‘builtin_function_or_method’ object is not iterable Remember: () calls the method!
Python Pandas 3.0 introduces pd.col, which shortens queries: Also:
Think “from modname import funcname” saves memory in Python? It doesn’t! (Lots of people think it does.) The full module still loads (see sys.modules). The only difference: “modname” isn’t in your namespace, just “funcname”. “from import” is convenient. It doesn’t save memory.
🎉 Pandas 3 is out! As of last week, saying “pip install pandas” or “uv add pandas” gives you the latest version. What’s new? What has changed? I’ve got a whole YouTube playlist, explaining what you need to know: https://www.youtube.com/playlist?list=PLbFHh-ZjYFwFWHVT0qeg9Jz1TBD0TlJJT
Heard about __new__, the constructor in Python? You can basically forget about it. It’s for advanced, unusual cases. Just use __init__! It runs automatically on every new instance. __init__ is for assigning attributes to self (what other languages call “instance variables”).
Know Python Pandas series methods? You already know data frame methods! Same methods, applied column-wise!
Reading a multi-sheet Excel file into Python Pandas? Ask for a specific sheet by name or index: Get a dict of data frames with specific sheets:
Using uv? The Python version is stored in .python-version. Change it with But: uv gives an error: 3.13 is incompatible with requires-python in pyproject.toml of ‘>=3.14.’
The AI revolution is here. Engineers at major companies are now using AI instead of writing code directly. But there’s a gap: Most developers know how to write code OR how to prompt AI, but not both. When working with real data, vague AI prompts produce code that might work on sample datasets but creates…