Tag: Python
-
functools.cache vs lru_cache: When 40% Speed Costs Stability
functools.cache runs 40% faster than lru_cache but can crash production. Benchmark data shows when unbounded caching breaks.
-
Gold Price Patterns: 10 Years of Market Data Analysis
10 years of gold price data reveals 3 volatility regimes and non-stationary patterns that ARIMA and LSTM models systematically miss.
-
Python contextlib: contextmanager and ExitStack Deep Dive
Stop writing repetitive try-finally blocks. Python's @contextmanager and ExitStack manage resources in 3 linesโbenchmarks and gotchas included.
-
dataclasses vs Pydantic vs attrs: Python Data Model Guide
dataclasses vs Pydantic vs attrs: real benchmarks, validation tradeoffs, and which to pick for production. Spoiler: speed isn't the deciding factor.
-
Python Memory Profiling: tracemalloc and memray in Prod
Debugged a 47GB memory leak in production using tracemalloc and memray. The exact profiling workflow I use to find Python leaks in under an hour.
-
Part 2: Statistical Rigor: Why Your Correlation Might Be Spurious
Catch 4 statistical traps that make correlations spurious: Simpson's Paradox, p-hacking, confounders. Includes bootstrap tests you can run today.
-
Interactive Dashboards with Plotly and Streamlit
Build a live data dashboard in 50 lines: Plotly + Streamlit with callbacks, filters, and hover tooltips. No JavaScript required.
-
Technical Indicators in Practice: MA, RSI, and MACD
Backtested RSI, MACD, and moving averages on 5 years of data. Results show which signals actually work and which are noise. Code included.