Data
NumPy, pandas and statistics: reading files, formatting numbers, describing distributions.
- Analysing Balance Sheet Financial Ratios with Python and pandas
Load a balance sheet into pandas, check that it balances, and compute liquidity and leverage ratios, year-on-year changes and a common-size view in a few lines.
- Binomial Distribution and Binomial Test in Python with SciPy
Compute binomial probabilities with scipy.stats.binom and run an exact binomial test with scipy.stats.binomtest: p-values, one-sided tests and confidence intervals.
- Continuous and Discrete Uniform Distributions in Python (PDF, CDF, Sampling)
Work with continuous and discrete uniform distributions in Python: scipy.stats.uniform and randint, PDF, PMF, CDF, quantiles, sampling with NumPy and fit tests.
- Fix UnicodeDecodeError When Reading a CSV File in pandas
Why pd.read_csv raises UnicodeDecodeError: 'utf-8' codec can't decode byte, and how to fix it with the right encoding, BOM handling and UTF-8 conversion.
- How to Suppress Scientific Notation in pandas and NumPy
Stop pandas and NumPy printing floats like 1.2e+09: set_printoptions(suppress=True), display.float_format, option_context, Styler and to_csv.
- Kurtosis in Python: SciPy, pandas and NumPy Explained
Compute kurtosis in Python with scipy.stats.kurtosis, pandas Series.kurt and NumPy. Excess vs Pearson, the bias flag, worked examples and how to interpret it.
- Poisson Distribution and Poisson Process in Python
Model event counts with scipy.stats.poisson (pmf, cdf, sf, ppf) and simulate a Poisson process in NumPy from exponential gaps, with checks against theory.
- Python Tutorial: Analysing Public Property-Price Data with pandas
A runnable pandas tutorial on HM Land Registry Price Paid Data (Open Government Licence v3.0): load a headerless 160 MB CSV with the right dtypes, filter standard sales, compute median prices by month and district, pivot by property type and plot a chart.
- pandas groupby: How to Group and Aggregate Data in Python
How pandas groupby works: sum and mean per group, several keys, named aggregation with agg, transform, filter, missing keys, dates and the pandas 3 defaults.
- pandas merge, join and concat: Combine DataFrames Without Losing Rows
How to combine DataFrames in pandas: pd.merge with inner, left, right and outer joins, indicator=True to find unmatched rows, left_on and right_on, suffixes, validate to catch duplicate keys, DataFrame.join on the index, pd.concat for stacking, and the key-type errors that make a merge return nothing.




