Skip to content

Commit f4a7c50

Browse files
miladsade96cclauss
authored andcommitted
converting generator object to a list object (TheAlgorithms#1602)
* converting generator object to a list object * Refactor: converting generator object to a list object * fixup! Format Python code with psf/black push
1 parent 4baf397 commit f4a7c50

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

machine_learning/linear_discriminant_analysis.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -295,10 +295,10 @@ def main():
295295
print("-" * 100)
296296

297297
# Calculating the value of probabilities for each class
298-
# An empty list to store values of probabilities for each class
299-
probabilities = (
298+
probabilities = [
300299
calculate_probabilities(counts[i], sum(counts)) for i in range(n_classes)
301-
)
300+
]
301+
302302
# for loop iterates over number of elements in 'probabilities' list and print
303303
# out them in separated line
304304
for i, probability in enumerate(probabilities, 1):

0 commit comments

Comments
 (0)