I have the following dataframe in python
Sex Survived
0 female 0.742038
1 male 0.188908
i would like to plot a histogram, where male and female are the two values in the x-axis and y axis has its corresponding values. Any idea how ? . I am new to matplotlib and pandas, so please help
In my opinion you need DataFrame.plot.bar
:
df.plot.bar(x='Sex', y='Survived')
because histogram
plot distribution of numerical data.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With