Skip to content

Commit 2fac028

Browse files
committed
added missing example, still very drafty
1 parent d3e346b commit 2fac028

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ with pyjviz.CB("WHY JANITOR?") as sg:
5353
pyjviz.save_dot(vertical = True, popup_output = True)
5454
```
5555

56-
The [`result`][res] of run is SVG file with clickable nodes to provide the way to see some details of program behaviour and generated data objects.
56+
The [`resulting SVG file`][res] of the run shows method chain calls along with intermidiate return and argument object. It has clickable nodes to provide the details of program behaviour and generated data objects.
5757

5858
[res]: https://asmirnov69.github.io/pyjviz-poc/docs/why-janitor.py.ttl.dot.svg
5959

examples/think-bayes2/t.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import pandas as pd
2+
import numpy as np
3+
from scipy.stats import poisson
4+
import pandas_flavor as pf
5+
import pyjviz
6+
7+
from empiricaldist import Pmf
8+
9+
if __name__ == "__main__":
10+
with pyjviz.CB() as cb:
11+
d6 = Pmf.from_seq([1,2,3,4,5,6])
12+
d6.pin()
13+
14+
lam = 1.4
15+
qs = np.arange(10)
16+
ps = poisson(lam).pmf(qs)
17+
d_poison = Pmf(ps, qs)
18+
d_poison.pin()
19+
20+
pyjviz.arrow(d6, 'goes to', d_poison)
21+
22+
pyjviz.save_dot()
23+

0 commit comments

Comments
 (0)