I was going nuts trying to figure out how to make days of the week show up in order on my plots. As always it turns out to be really simple once you know how. Thanks!
Thank you for creating these videos. They are great. Both the syntax for creating the plots as well as how seaborn creates these plots are explained very clearly.
Very good question - and I plan to address this in a seaborn Q&A video coming up! I would probably use matplotlib's plt.text() function to do this, but the tricky part will be grabbing the right numbers and lining up the values in the right spot. Something similar to what I did here: ruclips.net/video/NBYzSaTbodM/видео.html
Great question - the output looks very similar but the input can be quite different. For the histplot, you'll have a column of numbers. Those can be integers or floating point numbers with a decimal. Seaborn will automatically make buckets for those numbers and count up how many numbers it sees within the range of each bucket (e.g. how many numbers fall somewhere within 3 to 5?) With the countplot, however, you'll often have a column full of categorical items, such as a column full of text values like dog, cat, and bird. Seaborn will tally up how many of each item it sees in that column (e.g. how many times does the word "dog" appear in the "pets" column?). Things can get fancier from there, but that's the rough gist. 👍
So glad you are liking the series! Unfortunately, using percentages isn't currently an option within the countplot, but as Michael Waskom the author of seaborn points out, you could accomplish this using the seaborn barplot instead: github.com/mwaskom/seaborn/issues/1027
Right? That would be glorious, but it isn't a default option as far as I can tell for the current version of seaborn. (Though it is an option with the heatmap through the annot keyword.) It's a bit more challenging to write perfectly robust code to do this since the scale of the counts changes -- and especially for the barplot where we also have the confidence intervals to contend with. From what I have seen, cycling through the patches seems to be the best bet for now. You've probably already seen it, but if not, this post has some options: stackoverflow.com/questions/31749448/how-to-add-percentages-on-top-of-bars-in-seaborn
Great question and I plan to add this to my upcoming seaborn Q&A video! I would probably use matplotlib's plt.text() function, but the tricky part will be grabbing the right numbers and lining up the values in the right spot. Something similar to what I did here should do the trick: ruclips.net/video/NBYzSaTbodM/видео.html
you are great
Why thank you!
Nice. Informative
Thanks! Glad it was helpful!
Your videos are very helpful and informative, love what you are doing :)
Thanks a ton, Kimberly! I enjoy the way you teach and show the code without hiding anything. Great job!
I was going nuts trying to figure out how to make days of the week show up in order on my plots. As always it turns out to be really simple once you know how. Thanks!
Yet again, your videos are helping me understand my coursework. Thanks so much- PhD well deserved!
You well explained ma'am
Thanks for such vedio
If i had sea_animal , animals , weight , how i can put sea_animal , animal in y axis
And weight in x axis
Just now completed the whole seaborn playlist. Thank you so much for making it really easy for us.
Oh wow! Thanks for watching! Very glad to hear it was helpful.
Thank you for creating these videos. They are great. Both the syntax for creating the plots as well as how seaborn creates these plots are explained very clearly.
Thanks very much for the compliment! Glad to hear the syntax and the explanation are clear 😀
Can anyone suggest how can i annotate a seaborn countplot??
Powerful addition; thank you! Count axis is in decimals, however ... how to specify axis in integer values?
The videos are such high quality. Thankyou so much Kimberly! This playlist helped me alot
how to add data labels on the top of each bar with seaborn countplot?
Very good question - and I plan to address this in a seaborn Q&A video coming up! I would probably use matplotlib's plt.text() function to do this, but the tricky part will be grabbing the right numbers and lining up the values in the right spot. Something similar to what I did here: ruclips.net/video/NBYzSaTbodM/видео.html
I used both Histplot and Countplot on categorical data and both provided similar results so what is the difference between the two ?
Great question - the output looks very similar but the input can be quite different. For the histplot, you'll have a column of numbers. Those can be integers or floating point numbers with a decimal. Seaborn will automatically make buckets for those numbers and count up how many numbers it sees within the range of each bucket (e.g. how many numbers fall somewhere within 3 to 5?) With the countplot, however, you'll often have a column full of categorical items, such as a column full of text values like dog, cat, and bird. Seaborn will tally up how many of each item it sees in that column (e.g. how many times does the word "dog" appear in the "pets" column?). Things can get fancier from there, but that's the rough gist. 👍
@@KimberlyFessel Thanks a Lot😊
Thank you Kimberly, for making our life easier :))
thank u
How to show the number of counts on each bar using countplot?
Thank you very much. I found this series really helpful. I've a doubt with countplot? how do we display it with percentage instead of count/frequency?
So glad you are liking the series! Unfortunately, using percentages isn't currently an option within the countplot, but as Michael Waskom the author of seaborn points out, you could accomplish this using the seaborn barplot instead: github.com/mwaskom/seaborn/issues/1027
Thank you for creating this video
You are so welcome - thank you for watching this video!
I am your 4k subscriber! happy to be in 4k.
Yay! 🎉🎉Thanks for subscribing and welcome!
@@KimberlyFessel 🍗
Thank you so much mam ❤❤😍😍😍
This sns series is super cool
Good stuff!
Thanks! Glad you enjoyed it 😁
gud tut! ty
Thx! Great video! How to add numbers to the top of the bars? There are many examples, but shouldn’t that be a default option for bar and countplot?
Right? That would be glorious, but it isn't a default option as far as I can tell for the current version of seaborn. (Though it is an option with the heatmap through the annot keyword.) It's a bit more challenging to write perfectly robust code to do this since the scale of the counts changes -- and especially for the barplot where we also have the confidence intervals to contend with. From what I have seen, cycling through the patches seems to be the best bet for now. You've probably already seen it, but if not, this post has some options: stackoverflow.com/questions/31749448/how-to-add-percentages-on-top-of-bars-in-seaborn
@@KimberlyFessel thank you for the insight!
Thanks!
Sure thing - cheers!
Hi, Please, How do we print the number above each bar? thanks a lot.
Great question and I plan to add this to my upcoming seaborn Q&A video! I would probably use matplotlib's plt.text() function, but the tricky part will be grabbing the right numbers and lining up the values in the right spot. Something similar to what I did here should do the trick: ruclips.net/video/NBYzSaTbodM/видео.html
@@KimberlyFessel thanks for your reply 😀
Great series of videos for Seaborn. Would you like to make a video about factorplot?
Oops, it seems that factorplot is a older version of catplot. I will check out your catplot video!
Yes! I was just about to recommend the catplot - it has a lot of great functionality!
Absolutely great video
Very glad you enjoyed it! 😄
Professional content👏
Thanks very much! 😄
The outtakes at the end are hilarious!
Haha - glad you enjoyed them! I like having fun with those. 😄
Was really useful🙌
So good to hear that! 😄
Thanks.
Most welcome!
great video. love it!
Thank you very much - I appreciate the support! 😄
Love the way you teach
Why thank you!
@@KimberlyFessel because it was the easy way, we got everything very soon