Skip to content

Commit bfd6566

Browse files
committed
numpy random s/randn/standard_normal/
1 parent 9fa6aec commit bfd6566

File tree

28 files changed

+32
-30
lines changed

28 files changed

+32
-30
lines changed

examples/express/accordion_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ def txt():
1717

1818
@render.plot
1919
def histogram():
20-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
20+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
2121
plt.hist(x, input.n(), density=True)

examples/express/column_wrap_app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@
1212

1313
@render.plot
1414
def histogram():
15-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
15+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
1616
plt.hist(x, input.n(), density=True)
1717

1818
with ui.card():
1919

2020
@render.plot
2121
def histogram2():
22-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
22+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
2323
plt.hist(x, input.n(), density=True, color="red")

examples/express/nav_app.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
@render.plot
1515
def histogram():
16-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
16+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
1717
plt.hist(x, input.n(), density=True)
1818

1919
with ui.navset_card_underline():
@@ -24,5 +24,5 @@ def histogram():
2424

2525
@render.plot
2626
def histogram2():
27-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
27+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
2828
plt.hist(x, input.n2(), density=True)

examples/express/plot_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99

1010
@render.plot
1111
def histogram():
12-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
12+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
1313
plt.hist(x, input.n(), density=True)

examples/express/shared_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
@render.plot
1414
def histogram():
15-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
15+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
1616
plt.hist(x, shared.rv(), density=True)
1717

1818

examples/express/sidebar_app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@
1010

1111
@render.plot
1212
def histogram():
13-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
13+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
1414
plt.hist(x, input.n(), density=True)

examples/static_plots/app.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def plotnine():
9999
@render.plot
100100
def pandas():
101101
ts = pd.Series(
102-
rng.randn(1000),
102+
rng.standard_normal(1000),
103103
index=pd.date_range("1/1/2000", periods=1000),
104104
)
105105
ts = ts.cumsum()

shiny/api-examples/input_action_button/app-core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def server(input: Inputs, output: Outputs, session: Session):
1616
# (not when the slider is changed)
1717
@reactive.event(input.go, ignore_none=False)
1818
def plot():
19-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(input.n())
19+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(input.n())
2020
fig, ax = plt.subplots()
2121
ax.hist(x, bins=30, density=True)
2222
return fig

shiny/api-examples/input_action_button/app-express.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# (not when the slider is changed)
1414
@reactive.event(input.go, ignore_none=False)
1515
def plot():
16-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(input.n())
16+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(input.n())
1717
fig, ax = plt.subplots()
1818
ax.hist(x, bins=30, density=True)
1919
return fig

shiny/api-examples/input_action_link/app-core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def server(input: Inputs, output: Outputs, session: Session):
1616
# the slider is changed
1717
@reactive.event(input.go, ignore_none=False)
1818
def plot():
19-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(input.n())
19+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(input.n())
2020
fig, ax = plt.subplots()
2121
ax.hist(x, bins=30, density=True)
2222
return fig

shiny/api-examples/input_action_link/app-express.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# the slider is changed
1414
@reactive.event(input.go, ignore_none=False)
1515
def plot():
16-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(input.n())
16+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(input.n())
1717
fig, ax = plt.subplots()
1818
ax.hist(x, bins=30, density=True)
1919
return fig

shiny/api-examples/input_dark_mode/app-core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def _():
4545

4646
@render.plot(alt="A histogram")
4747
def plot() -> object:
48-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
48+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
4949

5050
fig, ax = plt.subplots()
5151
ax.hist(x, input.n(), density=True)

shiny/api-examples/input_dark_mode/app-express.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
@render.plot(alt="A histogram")
1515
def plot() -> object:
16-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
16+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
1717

1818
fig, ax = plt.subplots()
1919
ax.hist(x, input.n(), density=True)

shiny/api-examples/input_slider/app-core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
def server(input: Inputs, output: Outputs, session: Session):
1313
@render.plot
1414
def distPlot():
15-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
15+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
1616

1717
fig, ax = plt.subplots()
1818
ax.hist(x, input.obs(), density=True)

shiny/api-examples/input_slider/app-express.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
@render.plot
1010
def distPlot():
11-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
11+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
1212

1313
fig, ax = plt.subplots()
1414
ax.hist(x, input.obs(), density=True)

shiny/api-examples/isolate/app-core.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ def plot():
1818

1919
# ...but don't take a reactive dependency on the slider
2020
with reactive.isolate():
21-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(input.n())
21+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(
22+
input.n()
23+
)
2224

2325
fig, ax = plt.subplots()
2426
ax.hist(x, bins=30, density=True)

shiny/api-examples/isolate/app-express.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def plot():
1515

1616
# ...but don't take a reactive dependency on the slider
1717
with reactive.isolate():
18-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(input.n())
18+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(input.n())
1919

2020
fig, ax = plt.subplots()
2121
ax.hist(x, bins=30, density=True)

shiny/api-examples/layout_sidebar/app-core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
def server(input: Inputs, output: Outputs, session: Session):
1717
@render.plot(alt="A histogram")
1818
def plot() -> object:
19-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
19+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
2020

2121
fig, ax = plt.subplots()
2222
ax.hist(x, input.n(), density=True)

shiny/api-examples/layout_sidebar/app-express.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
@render.plot(alt="A histogram")
1111
def plot() -> object:
12-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
12+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
1313

1414
fig, ax = plt.subplots()
1515
ax.hist(x, input.n(), density=True)

shiny/api-examples/output_plot/app-core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
def server(input: Inputs, output: Outputs, session: Session):
1515
@render.plot
1616
def p():
17-
x_rand = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
17+
x_rand = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
1818
fig, ax = plt.subplots()
1919
ax.hist(x_rand, int(input.n()), density=True)
2020
return fig

shiny/api-examples/output_plot/app-express.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
@render.plot
1010
def p():
11-
x_rand = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
11+
x_rand = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
1212
fig, ax = plt.subplots()
1313
ax.hist(x_rand, int(input.n()), density=True)
1414
return fig

shiny/api-examples/page_fixed/app-core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
def server(input: Inputs, output: Outputs, session: Session):
1919
@render.plot(alt="A histogram")
2020
def plot() -> object:
21-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
21+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
2222

2323
fig, ax = plt.subplots()
2424
ax.hist(x, input.n(), density=True)

shiny/api-examples/page_fixed/app-express.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
@render.plot(alt="A histogram")
1414
def plot() -> object:
15-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
15+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
1616

1717
fig, ax = plt.subplots()
1818
ax.hist(x, input.n(), density=True)

shiny/api-examples/page_fluid/app-core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
def server(input: Inputs, output: Outputs, session: Session):
1717
@render.plot(alt="A histogram")
1818
def plot() -> object:
19-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
19+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
2020

2121
fig, ax = plt.subplots()
2222
ax.hist(x, input.n(), density=True)

shiny/api-examples/page_fluid/app-express.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
@render.plot(alt="A histogram")
1414
def plot() -> object:
15-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
15+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
1616

1717
fig, ax = plt.subplots()
1818
ax.hist(x, input.n(), density=True)

shiny/api-examples/page_sidebar/app-core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
def server(input: Inputs, output: Outputs, session: Session):
1717
@render.plot(alt="A histogram")
1818
def plot() -> object:
19-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
19+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
2020

2121
fig, ax = plt.subplots()
2222
ax.hist(x, input.n(), density=True)

shiny/api-examples/page_sidebar/app-express.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
@render.plot(alt="A histogram")
1111
def plot() -> object:
12-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
12+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
1313

1414
fig, ax = plt.subplots()
1515
ax.hist(x, input.n(), density=True)

shiny/api-examples/row/app-core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
def server(input: Inputs, output: Outputs, session: Session):
1515
@render.plot(alt="A histogram")
1616
def plot() -> object:
17-
x = 100 + 15 * np.random.default_rng(seed=19680801).randn(437)
17+
x = 100 + 15 * np.random.default_rng(seed=19680801).standard_normal(437)
1818

1919
fig, ax = plt.subplots()
2020
ax.hist(x, input.n(), density=True)

0 commit comments

Comments
 (0)