Use fixed seeds for reproducible pseudorandomness
authorDebian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Sun, 13 Nov 2022 10:36:51 +0000 (10:36 +0000)
committerGraham Inggs <ginggs@debian.org>
Sun, 13 Nov 2022 10:36:51 +0000 (10:36 +0000)
Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Forwarded: no

Gbp-Pq: Name fix_random_seeds.patch

doc/source/getting_started/comparison/comparison_with_r.rst
doc/source/user_guide/advanced.rst
doc/source/user_guide/visualization.rst

index 864081002086b4e8c145ced00631824517fe4637..4cbd655c0fb82d21d2d62ac3e124e30acd65d0f2 100644 (file)
@@ -241,6 +241,7 @@ In pandas we may use :meth:`~pandas.pivot_table` method to handle this:
 
    import random
    import string
+   random.seed(123456) # for reproducibility
 
    baseball = pd.DataFrame(
        {
index 3b33ebe7010371182e0cd558e531b91352b7f714..380b2a78d2b9af207af39eae790542e824e7bcfc 100644 (file)
@@ -595,6 +595,7 @@ they need to be sorted. As with any index, you can use :meth:`~DataFrame.sort_in
 
    import random
 
+   random.seed(123456) # for reproducibility
    random.shuffle(tuples)
    s = pd.Series(np.random.randn(8), index=pd.MultiIndex.from_tuples(tuples))
    s
index 1c02be989eeeb42e2fa7da079e975ff27dad787e..7ec961c65c2650eb363338bfbd9ef33543649159 100644 (file)
@@ -996,6 +996,7 @@ autocorrelation plots.
    :suppress:
 
    np.random.seed(123456)
+   random.seed(123456) # for reproducibility - bootstrap_plot uses random.sample
 
 .. ipython:: python