From 8a2189775b8e2e77c8bf1a3b2dea808f5fd212f5 Mon Sep 17 00:00:00 2001 From: Adam Jemielita Date: Sat, 1 Apr 2023 21:14:43 +0200 Subject: [PATCH] changed deprecated numpy.float to float --- pygad.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pygad.py b/pygad.py index ddcbde28..83ca630b 100644 --- a/pygad.py +++ b/pygad.py @@ -1844,8 +1844,8 @@ def roulette_wheel_selection(self, fitness, num_parents): if fitness_sum == 0: raise ZeroDivisionError("Cannot proceed because the sum of fitness values is zero. Cannot divide by zero.") probs = fitness / fitness_sum - probs_start = numpy.zeros(probs.shape, dtype=numpy.float) # An array holding the start values of the ranges of probabilities. - probs_end = numpy.zeros(probs.shape, dtype=numpy.float) # An array holding the end values of the ranges of probabilities. + probs_start = numpy.zeros(probs.shape, dtype=float) # An array holding the start values of the ranges of probabilities. + probs_end = numpy.zeros(probs.shape, dtype=float) # An array holding the end values of the ranges of probabilities. curr = 0.0 @@ -1888,8 +1888,8 @@ def stochastic_universal_selection(self, fitness, num_parents): if fitness_sum == 0: raise ZeroDivisionError("Cannot proceed because the sum of fitness values is zero. Cannot divide by zero.") probs = fitness / fitness_sum - probs_start = numpy.zeros(probs.shape, dtype=numpy.float) # An array holding the start values of the ranges of probabilities. - probs_end = numpy.zeros(probs.shape, dtype=numpy.float) # An array holding the end values of the ranges of probabilities. + probs_start = numpy.zeros(probs.shape, dtype=float) # An array holding the start values of the ranges of probabilities. + probs_end = numpy.zeros(probs.shape, dtype=float) # An array holding the end values of the ranges of probabilities. curr = 0.0