Use fixed seeds for reproducible pseudorandomness
authorDebian Science Team <debian-science-maintainers@lists.alioth.debian.org>
Sun, 19 Feb 2023 11:01:48 +0000 (11:01 +0000)
committerRebecca N. Palmer <rebecca_palmer@zoho.com>
Sun, 19 Feb 2023 11:01:48 +0000 (11:01 +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 f91f4218c3429b7ab83746ead63a62bd0acf0644..ac7628764fab00c22d00c3c557ab1830609a823b 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 b8df21ab5a5b4cd78d25db77ca4bf96f67784270..253033eaee6b557b72a7dac33fae27b2d436c090 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 147981f29476f035c025ad0791edc22390a3457e..2b05082bd40806d48d4f3174396ddd19833f3db6 100644 (file)
@@ -1019,6 +1019,7 @@ be passed, and when ``lag=1`` the plot is essentially ``data[:-1]`` vs.
    :suppress:
 
    np.random.seed(123456)
+   random.seed(123456) # for reproducibility - bootstrap_plot uses random.sample
 
 .. ipython:: python