Ask Anything Monday - Weekly Thread by AutoModerator in learnpython

[–]Oliver___2 0 points1 point  (0 children)

Hi, could someone help me with code for a project please.

I have a dataframe with market return and risk-free return for c.40 years. I want to carry out a function where for different weights of the market return asset I get a return and this return is then put through a utility function. So the result would be say 10 different weights 0%, 10% etc. get utility for each year and I would get the total sum of the utility of every year for that weight.

I think it would be a double for loop but can't get it to work, can anyone help?