diff --git a/.github/workflows/test-code.yml b/.github/workflows/test-code.yml index b9f098d..1eb3885 100644 --- a/.github/workflows/test-code.yml +++ b/.github/workflows/test-code.yml @@ -45,14 +45,14 @@ jobs: ./logpdf > logpdf.out ./rvs > rvs.out - cat rvs.out + cat logpdf.out working-directory: tests/test_output/normal/cpp - name: Run Python files run: | - python pdf.py - python logpdf.py - python rvs.py + python pdf.py > pdf.out + python logpdf.py > logpdf.out + python rvs.py > rvs.out - cat rvs.out + cat logpdf.out working-directory: tests/test_output/normal/python diff --git a/distribution_zoo/cont_uni/normal/code/python.md b/distribution_zoo/cont_uni/normal/code/python.md index cadf049..ffd5436 100644 --- a/distribution_zoo/cont_uni/normal/code/python.md +++ b/distribution_zoo/cont_uni/normal/code/python.md @@ -8,7 +8,10 @@ x = np.linspace(start={{{range_start}}}, stop={{{range_end}}}, num=50) mean = {{{mean}}} std = {{{std}}} -norm.pdf(x=x, loc=mean, scale=std) +y = norm.pdf(x=x, loc=mean, scale=std) + +for x_i, y_i in zip(x, y): + print(f'{x_i},{y_i}') ``` @@ -22,7 +25,10 @@ x = np.linspace(start={{{range_start}}}, stop={{{range_end}}}, num=50) mean = {{{mean}}} std = {{{std}}} -norm.logpdf(x=x, loc=mean, scale=std) +y = norm.logpdf(x=x, loc=mean, scale=std) + +for x_i, y_i in zip(x, y): + print(f'{x_i},{y_i}') ``` @@ -34,5 +40,8 @@ from scipy.stats import norm n = 50 mean = {{{mean}}} std = {{{std}}} -norm.rvs(loc=mean, scale=std, size=n) +rvs = norm.rvs(loc=mean, scale=std, size=n) + +for rv in rvs: + print(rv) ```