Pandas Recipes
One-line answers to the operations that come up on every panel: shift, roll, rank and correlate within groups. Plus the idioms that survive library upgrades.
Pandas by verb
One line for each operation that comes up on every panel. Shift within group, roll per group, transform versus apply, correlate per date, rank and bucket, merge on date, resample. Each written in the form that survives pandas upgrades.
Groupby: transform versus apply versus agg
Three groupby verbs that look interchangeable and are not. Which one to reach for when the result should be one number per group, one value per row, or something else entirely.
Rolling windows per group, the version-safe way
Why g[col].transform(lambda x x.rolling(n)...) is used everywhere on this site instead of groupby.rolling, what min_periods does, and how to check a window by eye.
Portable pandas and Python idioms
Analysis code travels between machines. The syntax that older interpreters reject, the pandas calls whose behaviour has moved between releases, the forms that behave the same everywhere, and how to check what an environment has before trusting an answer found online.