I have a list consisting of a dictionary (Company and Revenue). I want to run an ABC analysis on this list and am looking for the most efficient way to do it.
myList = [{"Company":"Company A", "Revenue":100}, {"Company":"Company B", "Revenue":350}, {"Company":"Company C", "Revenue":80}]
I want to use cumsum from numpy. So I first have to sort the revenue in reverse order. I would do it like this:
newList = sorted(myList, key=lambda k: k['Revenue'], reverse=True)
How do I get now the cumulative sum over the revenue in order to be able to carry out an ABC analysis?