Python Lesson 10: pandas — Summaries and Pivot Tables
Summarise data with pandas: groupby with sum and count, several aggregations with agg, pivot_table with totals, top-N with nlargest, monthly summaries, and percentage of…
Read article →Excel, SAP, Oracle & automation tips — plus wacky facts
Start-to-finish programming for people who work with data: Python, SQL, Java, R, JavaScript, Rust and PowerShell.
Summarise data with pandas: groupby with sum and count, several aggregations with agg, pivot_table with totals, top-N with nlargest, monthly summaries, and percentage of…
Read article →Clean a real-world messy export with pandas: tidy column names, trim and fix case, turn “Rs 1,23,000” into numbers, parse mixed date formats, remove…
Read article →Start with pandas: read CSV and Excel files into a DataFrame, check shape and data types, view rows, add calculated columns, and filter rows…
Read article →Read and write CSV files with Python’s standard library: open with a with-block, csv.DictReader, totals with defaultdict, writing a result file, encodings, and file…
Read article →Write your own reusable functions with def: parameters, default values, return, docstrings, and practical examples like GST, financial-year labels and grading — Python’s version…
Read article →Repeat work with for loops over lists, dictionaries and ranges, count and total inside loops, list comprehensions, while loops, and break/continue — the code…
Read article →Hold many values with lists (indexing, append, sort, slices) and look things up with dictionaries (keys, get, items) — Python’s versions of a column…
Read article →Make decisions in Python: comparisons, if/elif/else blocks and indentation, and/or/not, one-line conditional expressions, and the IF patterns from Excel translated to Python.
Read article →Store values in variables, use int, float, str and bool, do maths with rounding, format output with f-strings including thousands separators, and convert between…
Read article →Install Python on Windows the right way, use VS Code or IDLE, run a script from the terminal, use the interactive prompt, and install…
Read article →Call web APIs with fetch, async/await, check response status, parse JSON, handle errors and offline cases, and where API keys must never go.
Read article →Make a page interactive: select elements with getElementById and querySelector, read input values, handle click events, change text and create elements.
Read article →Bones are stronger than steel of the same weight.
Weight for weight, bone is remarkably strong, especially under compression, because of its mix of collagen and mineral.