From: Debian Science Team Date: Fri, 28 Jan 2022 19:22:53 +0000 (+0000) Subject: Use fixed seeds for reproducible pseudorandomness X-Git-Tag: archive/raspbian/1.5.3+dfsg-2+rpi1~1^2^2^2^2^2^2^2~19 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4a178d310c93c887ee737872e5a72d57c9ddc6cc;p=pandas.git Use fixed seeds for reproducible pseudorandomness Author: Rebecca N. Palmer Forwarded: no Gbp-Pq: Name fix_random_seeds.patch --- diff --git a/doc/source/getting_started/comparison/comparison_with_r.rst b/doc/source/getting_started/comparison/comparison_with_r.rst index 86408100..4cbd655c 100644 --- a/doc/source/getting_started/comparison/comparison_with_r.rst +++ b/doc/source/getting_started/comparison/comparison_with_r.rst @@ -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( { diff --git a/doc/source/user_guide/advanced.rst b/doc/source/user_guide/advanced.rst index 3b33ebe7..380b2a78 100644 --- a/doc/source/user_guide/advanced.rst +++ b/doc/source/user_guide/advanced.rst @@ -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 diff --git a/doc/source/user_guide/visualization.rst b/doc/source/user_guide/visualization.rst index 1c02be98..7ec961c6 100644 --- a/doc/source/user_guide/visualization.rst +++ b/doc/source/user_guide/visualization.rst @@ -996,6 +996,7 @@ autocorrelation plots. :suppress: np.random.seed(123456) + random.seed(123456) # for reproducibility - bootstrap_plot uses random.sample .. ipython:: python