Invest model python