Resources


A short, opinionated list of further reading and tools.

Books

  • The Psychology of Money, by Morgan Housel 1
  • I Will Teach You to Be Rich (2nd ed.), by Ramit Sethi 2
  • The Algebra of Wealth, by Scott Galloway 3
  • The Little Book of Common Sense Investing, by John C. Bogle 4
  • The Simple Path to Wealth, by J. L. Collins 5

Podcasts & channels

Blogs & sites

Communities

  • r/personalfinance: the wiki is unusually good
  • Bogleheads: forum and wiki around low-cost index investing, the community John Bogle inspired

Tools

  • Spreadsheets (Google Sheets / Excel): still the most flexible option
  • Account aggregators (Monarch, Copilot, YNAB)

References

Color Palette

The mermaid diagrams throughout this book use a consistent Atomic Age / Mid-Century Modern palette. Each color is assigned to a semantic role:

Role Color Name Hex Text Usage
green Forest Green #48a56a #F5F2E8 Root / start / end nodes
primary Ocean Teal #0e9aa7 #F5F2E8 Process and action nodes
decision Blush Pink #f0cfcf #1C1C1E Decision / branching nodes
outcome Mint #86ddcd #1C1C1E Positive result nodes
warn Atomic Red #f44242 #F5F2E8 Warning / negative nodes
n/a Space Black #1C1C1E n/a Borders, arrows, body text
n/a Cream #F5F2E8 n/a Light text on dark fills

Notable Differences Between R and Python

This section collects differences between R and Python that matter when you read or adapt the code in this book but aren’t covered in a chapter’s own R vs Python callout. Use it as a reference when an example behaves differently than you expect.

String Formatting

R uses paste(), paste0(), sprintf(), or glue::glue() for string construction.

Python uses f-strings, the .format() method, or % formatting.

name <- "John"
paste0("Hello, ", name)
glue::glue("Hello, {name}")
name = "John"
f"Hello, {name}"

Whitespace Rules

Spaces, line breaks, and indentation are flexible and stylistic in R.

In Python, indentation is syntactic (inconsistent indentation raises an IndentationError). Blank lines are ignored but can be used to separate code blocks for readability.

# R: all of this is valid
# and produces the same result

# Clean, conventional style
if (x > 0) {
  result <- x * 2
  print(result)
}

# Messy but still valid
if(x>0){result<-x*2
    print(result)}

# Extreme and ugly but works
if   (  x > 0  )    {
result        <-x*2
   print(   result   )
              }
# Python: indentation matters
# Correct: consistent 4-space
# indentation
if x > 0:
    result = x * 2
    print(result)

# Blank lines are fine:
# they improve readability
def process(x):

    if x > 0:
        result = x * 2

        print(result)

    return result

# Raises IndentationError
if x > 0:
    result = x * 2
        print(result) # ❌ bad indent

Indexing

R uses 1-based indexing.

Python uses 0-based indexing.

vec <- c("a", "b", "c")
vec[1]   # returns "a"
lst = ["a", "b", "c"]
lst[0]   # returns "a"

Missing Values

R uses NA (with variants like NA_integer_, NA_character_), plus NULL and NaN.

Python uses None natively; polars represents missing values as null in its columnar data structures.

x <- c(1, NA, 3)
is.na(x)
import polars as pl
s = pl.Series([1, None, 3])
s.is_null()

Package Management

In R, packages are installed with install.packages() and loaded with library().

In Python, packages are installed via pip or conda from the terminal and loaded with import.

install.packages("dplyr")
library(dplyr)
# terminal: pip install polars
import polars as pl

Comments

In R, comments are single-line only, using #. No multi-line comment syntax.

In Python, single-line comments use #. Triple-quoted strings ("""...""") are commonly used as block comments or docstrings.

# This is a comment
# This is a comment

"""
This is a multi-line
comment or docstring.
"""

  1. The Psychology of Money: Timeless Lessons on Wealth, Greed, and Happiness. Housel, Morgan. 2020.↩︎

  2. I Will Teach You to Be Rich (2nd ed.). Sethi, Ramit. 2019.↩︎

  3. The Algebra of Wealth: A Simple Formula for Financial Security. Galloway, Scott. 2024.↩︎

  4. The Little Book of Common Sense Investing (10th Anniversary ed.). Bogle, John C. 2017.↩︎

  5. The Simple Path to Wealth. Collins, J. L. 2016.↩︎

  6. The Financial Order of Operations. Preston, Brian. 2024.↩︎