Skip to content

Commit

Permalink
Merge pull request #168 from adamj34/fix-numpy-float
Browse files Browse the repository at this point in the history
Changed deprecated numpy.float to float
  • Loading branch information
ahmedfgad committed Apr 3, 2023
2 parents b1efede + 8a21897 commit 30dd023
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pygad.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down

0 comments on commit 30dd023

Please sign in to comment.