2
0
Fork 0
mirror of https://github.com/MartinThoma/LaTeX-examples.git synced 2025-04-25 22:38:04 +02:00

Add normal distribution table

This commit is contained in:
Martin Thoma 2016-03-27 14:24:27 +02:00
parent c4afe1e2ad
commit 4983c8c734
7 changed files with 240 additions and 0 deletions

View file

@ -0,0 +1,13 @@
#!/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 + "\\\\")