Skip to content

Tag: for-loop

Implementing for loops as batches

I’m performing 2 big for loop tasks on a dataframe column. The context being what I’m calling “text corruption”; turning perfectly structured text into text full of both missing punctuation and misspellings, to mimic human errors. I found that running 10,000s rows was extremely slow, e…

For doesn’t restart on dataframe in python

i need do read the rows of a dataframe but it seems to stop at the first row. I also tried with iterrows but the results are similar. and the outpus is : so the for doesn’t iterate. I hope someone can help me, thank you so much. Answer You are performing inside the loop. This breaks the loop on

How do I iterate over two lists?

I have troubles in using for loops in Python. I wrote this code: and the output is: But I would like the output to be: Is there a way to make the for loop iterate over first “Mary” and “she” and then “Joe” and “he” ? I thank you in advance. Answer Why, you can g…