Skip to content

Commit e43cf21

Browse files
Debian Science Teamrebecca-palmer
Debian Science Team
authored andcommitted
Use fixed seeds for reproducible pseudorandomness
Author: Rebecca N. Palmer <[email protected]> Forwarded: no Gbp-Pq: Name fix_random_seeds.patch
1 parent 1a36800 commit e43cf21

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

doc/source/getting_started/comparison/comparison_with_r.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ In pandas we may use :meth:`~pandas.pivot_table` method to handle this:
241241
242242
import random
243243
import string
244+
random.seed(123456) # for reproducibility
244245
245246
baseball = pd.DataFrame(
246247
{

doc/source/user_guide/advanced.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,7 @@ they need to be sorted. As with any index, you can use :meth:`~DataFrame.sort_in
595595
596596
import random
597597
598+
random.seed(123456) # for reproducibility
598599
random.shuffle(tuples)
599600
s = pd.Series(np.random.randn(8), index=pd.MultiIndex.from_tuples(tuples))
600601
s

doc/source/user_guide/visualization.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,6 +1019,7 @@ be passed, and when ``lag=1`` the plot is essentially ``data[:-1]`` vs.
10191019
:suppress:
10201020
10211021
np.random.seed(123456)
1022+
random.seed(123456) # for reproducibility - bootstrap_plot uses random.sample
10221023
10231024
.. ipython:: python
10241025

0 commit comments

Comments
 (0)