From de24186788a2958351ab86866bc41f7742f2bb62 Mon Sep 17 00:00:00 2001 From: Roy Hyunjin Han Date: Sun, 24 Oct 2021 09:49:16 -0400 Subject: [PATCH] Replace deprecated functions seed and randr ``` np.random.seed => np.random.default_rng np.random.randn => rng.standard_normal ``` --- examples/statistics/histogram_features.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/statistics/histogram_features.py b/examples/statistics/histogram_features.py index 31f88384f24c..6599494a858d 100644 --- a/examples/statistics/histogram_features.py +++ b/examples/statistics/histogram_features.py @@ -20,12 +20,12 @@ import numpy as np import matplotlib.pyplot as plt -np.random.seed(19680801) +rng = np.random.default_rng(seed=19680801) # example data mu = 100 # mean of distribution sigma = 15 # standard deviation of distribution -x = mu + sigma * np.random.randn(437) +x = mu + sigma * rng.standard_normal(437) num_bins = 50