Skip to content

Commit 30dd023

Browse files
authored
Merge pull request #168 from adamj34/fix-numpy-float
Changed deprecated numpy.float to float
2 parents b1efede + 8a21897 commit 30dd023

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pygad.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -1844,8 +1844,8 @@ def roulette_wheel_selection(self, fitness, num_parents):
18441844
if fitness_sum == 0:
18451845
raise ZeroDivisionError("Cannot proceed because the sum of fitness values is zero. Cannot divide by zero.")
18461846
probs = fitness / fitness_sum
1847-
probs_start = numpy.zeros(probs.shape, dtype=numpy.float) # An array holding the start values of the ranges of probabilities.
1848-
probs_end = numpy.zeros(probs.shape, dtype=numpy.float) # An array holding the end values of the ranges of probabilities.
1847+
probs_start = numpy.zeros(probs.shape, dtype=float) # An array holding the start values of the ranges of probabilities.
1848+
probs_end = numpy.zeros(probs.shape, dtype=float) # An array holding the end values of the ranges of probabilities.
18491849

18501850
curr = 0.0
18511851

@@ -1888,8 +1888,8 @@ def stochastic_universal_selection(self, fitness, num_parents):
18881888
if fitness_sum == 0:
18891889
raise ZeroDivisionError("Cannot proceed because the sum of fitness values is zero. Cannot divide by zero.")
18901890
probs = fitness / fitness_sum
1891-
probs_start = numpy.zeros(probs.shape, dtype=numpy.float) # An array holding the start values of the ranges of probabilities.
1892-
probs_end = numpy.zeros(probs.shape, dtype=numpy.float) # An array holding the end values of the ranges of probabilities.
1891+
probs_start = numpy.zeros(probs.shape, dtype=float) # An array holding the start values of the ranges of probabilities.
1892+
probs_end = numpy.zeros(probs.shape, dtype=float) # An array holding the end values of the ranges of probabilities.
18931893

18941894
curr = 0.0
18951895

0 commit comments

Comments
 (0)