From a dict of columns
What it is
pd.DataFrame({"a": [...], "b": [...]}) builds column by column. Each value becomes a Series, keys become column names.
Why it matters
This is the clearest constructor because it matches how a DataFrame is actually laid out, and it lets you set each column's dtype independently.
In the real world: Writing a quick test table of five orders to check that a discount calculation gives the right totals before running it on real data.
df = pd.DataFrame({
"user_id": pd.Series([1, 2, 3], dtype="int64"),
"spend": [9.99, 12.50, 0.0],
"tier": pd.Series(["a", "b", "a"], dtype="category"),
})