df["amount"].sum()
df["amount"].mean()
df["amount"].median()
df["amount"].std()
df["amount"].max()
df["amount"].min()
df["amount"].count()
df["amount"].quantile(0.95)
df.sum(numeric_only=True)
df.mean(numeric_only=True)
df.describe()
df["amount"].agg(["sum", "mean", "min", "max"])
df.agg({
"amount": ["sum", "mean"],
"quantity": ["sum", "max"],
})
def iqr(s):
return s.quantile(0.75) - s.quantile(0.25)
df["amount"].agg(["mean", iqr])
.sum(), .mean() etc..agg(["sum","mean"]) runs many at once..describe() is the quickest "show me everything" summary.For a numeric column of your choosing, print mean, median, min, max, and 95th percentile in a single .agg() call.