I have a function that has a "for" loop that has to iterate through a generator, but, actually, it doesn't iterate.
def join_probabilities(prob_generator, importance):
probabilities, count = {}, 0
print('Before the "for" loop')
for text_probabilities in prob_generator:
print('In the "for" loop')
I've added 2 prints, but when I run the function, I see only the first of them. What may be wrong?
Thanks, I've found the problem. The generator is empty, and the problem is in creating the generator. But it is already another question.