samedi 22 janvier 2022

Generate random time series data with increasing trend

Is there a way in Python to spread a population over a period of time with an increasing trend?

For instance, assuming I have 1000 people to distribute between 1901 and 2000, the result I expect is like:

result = {1901: 6, 1902: 4, 1903: 8, 1904: 8, ..., 1997: 20, 1998: 22, 1999: 18, 2000: 21}

The sum of the values ​​in the dictionary result (6 + 4 + 8 + 8 + ... + 20 + 22 + 18 + 21) should be 1000. It should be possible to adjust the value of the first year and that of the last (to determine how much the series should be increasing)




Aucun commentaire:

Enregistrer un commentaire