2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-19 11:38:05 +02:00
LaTeX-examples/documents/normal-distribution/generate_numbers.py
2016-03-27 14:24:27 +02:00

13 lines
399 B
Python

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