I have a dataset with columns "Company" and "Outcome".
Company is a company name, Outcome is either success or failure
I have created the following graph with this code. How can I sort this so that the top has the most "Outcomes" (i.e. combined Success and Failure) and it goes down in a descending manner?
The code I used is:
df = pd.DataFrame({'Company': ['C', 'A', 'A', 'B', 'B', 'B', 'B'], 'Outcome': ['Success', 'Success', 'Failure', 'Failure', 'Success', 'Failure','Success' ]})
df.groupby(['Company', 'Outcome']).size().unstack().plot(kind = 'barh', stacked=True)
plt.show()
Additionally, including sort_values() after size() does not appear to have any effect, so clearly I am using it wrong. Any advice?

sort_values, what are you sorting on? 'Company'? If so it would do it alphabetically.