Skip to content

Commit

Permalink
Update code
Browse files Browse the repository at this point in the history
  • Loading branch information
fcooper8472 committed Jan 3, 2024
1 parent 19ad405 commit 2a40800
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/test-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
15 changes: 12 additions & 3 deletions distribution_zoo/cont_uni/normal/code/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
```


Expand All @@ -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}')
```


Expand All @@ -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)
```

0 comments on commit 2a40800

Please sign in to comment.