Categorize birth-death data in epochs
Loop over all individuals.
Expand "birth .. death" years into epochs.
If epoch granularity was 12 months,
then you would generate 30 rows for a 30-year old,
and so on.
Your granularity is much coarser,
with valid epoch labels being just {1900, 1980},
so each individual will have just one or two rows.
One of your examples would have a "1900, Mark" row,
and a "1980, Mark" row, indicating he was alive
for some portion of both epochs.
Now just sort values and group by,
to count how many 1900 rows and
how many 1980 rows there are.
Report the per-epoch counts.
Or report names of folks alive in each epoch,
if that's the level of detail you need.
I have data regarding the years of birth and death of several people. I want to compute efficiently how many people are in each of a group of pre-defined epochs.
For example. If I have this list of data:

Paul 1920-1950
Sara 1930-1950
Mark 1960-2020
Lennard 1960-1970

and I define the epochs 1900-1980 and 1980-2023, I would want to compute the number of people alive in each period (not necessarily the whole range of the years). In this case, the result would be 4 people (Paul, Sara, Mark and Lennard) for the first epoch and 1 person (Mark) for the second epoch.
Is there any efficient routine out there? I would like to know, as the only way I can think of now is to create a huge loop with a lot of ifs to start categorizing.
I really appreciate any help you can provide.