[Python] summing column values less than threshold to one row [closed]

Discussão em 'Python' iniciado por Stack, Março 20, 2025.

  1. Stack

    Stack Membro Participativo

    enter image description here

    Hello, I have a data set that includes two columns: nationality and number of people from each nationality. The problem is that nationalities with fewer than 100 individuals should be summed into one row in the same column, labeled 'Other'. The dataset should include nationalities with more than 100 individuals and a row that shows the sum of other nationalities with fewer than 100 individuals.

    How can I do this in both Python and R, please?

    Continue reading...

Compartilhe esta Página