generate_numbers.py 399 B

1234567891011121314
  1. #!/usr/bin/env python
  2. """Generate the LaTeX code for a table of the CDF of a normal distribution."""
  3. from scipy.stats import norm
  4. from numpy import arange
  5. for x in arange(0.0, 4.0, 0.1):
  6. line = "\\textbf{%0.1f} & " % x
  7. values = [norm.cdf(x+dx) for dx in arange(0.00, 0.09 + 0.01, 0.01)]
  8. values = ["%0.4f" % el for el in values]
  9. line += " & ".join(values)
  10. print(line + "\\\\")