I have just learned to use pythonic lambda. Why this works:
print(max(my_firms, key=lambda firm: firm.num_members()))
But this will not:
plt.hist(my_firms, key=lambda firm: firm.num_members())
That is. I have a list, my_firms, that contains class instances, firm, that have a method num.members(). I want to do a histogram with the quantity of members of all firms in my_firms.
Thanks a lot