[Python] Generate Pandas Series Based off of Base Value and Percentage Growth Rate

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

  1. Stack

    Stack Membro Participativo

    I'm trying to generate a Pandas series that will start with two elements.

    base_value = 100
    growth_rate = .1
    num_values = 4


    to generate values values that grow from the base_value by the growth rate each time? [100,110,121,133.1] etc etc

    I thought that I might be able to use the shift function to grab the row above and then operate on that, but you can't shift a row on itself.

    Is there a good way to do this?

    Continue reading...

Compartilhe esta Página