I have a dataframe with both positive and negative values. I would like to show a bar chart that shows two bars, one bar shows the percentage of positive values and another percentage of negative values.
dummy = pd.DataFrame({'A' : [-4, -3, -1, 0, 1, 2, 3, 4, 5], 'B' : [-4, -3, -1, 0, 1, 2, 3, 4, 5]})
less_than_0 = dummy['A'][dummy['A'] < 0]
greater_than_0 = dummy['A'][dummy['A'] >= 0]
I am able to split the positive and negative values. I tried this using seaborn.
sns.barplot(dummy['A'])
but both positive and negative are coming in single bar. I tried this too
sns.barplot(less_than_0)
sns.barplot(greater_than_0)
Is there any way to show 2 bars, 1 for percentage of positive values and other for percentage of negative values?