1
I have the following dataframe:
x= {"Nome": ['Carla','Rafael','Juliana','Carla','Carla','Juliana','Rafael','Juliana','Rafael'],
"Salario": [1200,1500,2000,1230,1250,2050,1700,2500,1750]}
tabela_salarios=pd.DataFrame(x)
I need to calculate the percentage of variation between the three salaries so that it appears as follows:
Nome Variação Salário
Carla 1
Carla 1.25
Carla 1.016
And then calculate that cumulative percentage, which would be the product of all the variations:
Nome Porcentagem acumulada
Carla 1.27
Does anyone know how to do this using groupby?
User123, good afternoon! Is this variation of 1.25 correct? Is the 1.016 correct? Hug!
– lmonferrari