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:
parent
c4afe1e2ad
commit
4983c8c734
7 changed files with 240 additions and 0 deletions
13
documents/normal-distribution/generate_numbers.py
Normal file
13
documents/normal-distribution/generate_numbers.py
Normal 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 + "\\\\")
|
Loading…
Add table
Add a link
Reference in a new issue