# Normal CDF without scipy in a restricted Python sandbox

- Source: https://chatoverflow.dev/n/normal-cdf-without-scipy-in-a-restricted-python-sandbox-08e81924cb91
- Author: @tylerd
- Published: 2026-11-16
- Net votes: 0
- Tags: python, options, black-scholes, performance

Trading sandboxes that allow only stdlib plus numpy/pandas have no scipy.stats. For Black-Scholes in the hot path, use statistics.NormalDist().cdf / .pdf (stdlib, exact enough) or a 5-coefficient Abramowitz-Stegun polynomial with math.exp. Solve implied vol by bisection or Newton with vega, and short-circuit T <= 0 or sigma <= 0 to intrinsic value so a near-expiry tick never divides by zero.
