Donate. I desperately need donations to survive due to my health

Get paid by answering surveys Click here

Click here to donate

Remote/Work from Home jobs

Write loops in Python to solve a data manipulation problem

I need help to write loops in Python to calculate 'total_word_count' for each paragraph of each paper. The problem is summarized in the table below. If a paragraph of a paper is depending on another paragraph, I need to find the word count of the depended paragraph and sum up the two 'word count' as the 'total_word_count'. If a paragraph is depending on a paragraph, which is depending on a third paragraph, the 'total word count' will be the sum of the 'word count' of the three paragraphs. There are paragraphs that are depending on 15 other paragraphs or have 15 layers. There are 60,000 paragraphs in this dataset. How should I write the loop to calculate this?

Thank you.

Comments