I hope everyone finds this video helpful. The next video of the series will be posted tomorrow at the same time. The next video will cover how to create scatter plots. We will use UA-cam API data to plot views/likes from trending videos. We will also learn how to use color and size to add even more information to our plots, so be sure to check that out. I'd like to thank Brilliant for sponsoring this series. If you'd like to check them out then you can sign up with this link and get 20% off your premium subscription: brilliant.org/cms
@@SHUBHITTALUSBIS I've already started working on the material, but I don't know exactly when they'll be released. It takes a long time to put together an entire series, so it could be another month or two until I'm finished with those. I'll be releasing individual video in the meantime as well.
Corey Schafer great videos!! Can you let me know how to add value/count on each bar? Just in case if the count is almost similar it would be difficult to differentiate which bin has higher or lesser count..
Your courses are pure perfection. Excellently well thought, you just find a solution for every point I think of while the video is playing, you just get the answer for it in a simple smart way. Extremely well prepared, flawless presentations. I can't thank you enough.
Corey, I just recently started using matplotlib a lot and noticed you have lately uploaded its tutorials. Thanks man. Could you do a tutorial on Seaborn please? Thank you.
Thanks man. I was trying to understand this from Datacamp, which is PAID service... but I had to come to UA-cam, which is FREE to get the explanation that I wanted. Thank you and please keep up this great work.
for people who suffered with the csv file: copy the file to a text file, then use the following code to remove the " file_handle = open('New Text Document.txt') for line in file_handle: line.replace('"', '') # replace " with '' which is empty string after that copy the New Text Document to any CSV file you have and name it data
Thank you for publishing this. I've been working through histograms with huge data sets at work and this really helps me identify what is really needed to simply produce helpful charts.
Hey Corey, great fan here It really took me many months to find a channel where the concepts were explained so well. Keep up the good work! p.s Would you consider making a series on numpy and ai?
Hey Corey, really loving this series. Eagerly looking forward to the timeseries plot video. My question is is it possible to plot aliases for the bins? To clarify say we had three bins which are predefined and instead of showing the ranges of the bins we want to plot 'low', 'medium' and 'high' as the alias of sorts. I think something similarly was done in the bar charts video. Once again I love all your work not just this series.
Yes, you should be able to use the xticks method and pass in your own labels. You can find the xticks docs here: matplotlib.org/3.1.0/api/_as_gen/matplotlib.pyplot.xticks.html
A big thank you for your videos. I have done a small change, correct me if I am wrong. I am a beginner. I imported statistics, and for median_age I used ; median_age=sorted(data["Age"]) [ len(data["Age"])//2]
Hi Corey, truly, only you can make a histogram video so interesting! On the logarithmic scale, how would you add the count labels to each bar on the graphs? Thank you!
thanks for the awesome videos Corey, you are awesome!! by the way, what are your thoughts on VScode vs Sublime 3?? will you continue being faithful to sublime text? saludos desde Chile amigo!
I have been using VSCode for daily coding since it has so many nice features, but I will likely use Sublime for videos because I find it to be much more minimalist and less distracting.
While I appreciate all the course and amazing level of detail in which you have explained. It would've been so much better if there was just 1 dataset that you used to show all the charts, or at least only a couple of variations.
Hi Corey, first I am a big fan of your tutorials. I have learned most of my Python skills by them. At 7:00 you want to remove the 10-20 value from the histogram and just deleted the value in the list. I prefer to keep the original data as it is and use list funcionality bins=bins[1:] (plt.hist(ages, bins=bins[1:], edgecolor='black')) to remove values from the x-axis. Do I get something wrong or do you have a specific reason to do it your way?
what you are doing is fine, as long as it runs for this specific purpose. I guess that he did it that way just to keep it as simple as possible for educational purposes
I wrote the code verbatim, but no histogram showed up. It ran without issue though... Any tips on how to do this with excel sheets saved as cvs files? Any resources I could look at?
sorry i have a question when i installing the package " plt" . That is displayed " ERROR: Could not find a version that satisfies the requirement plt (from versions: none) ERROR: No matching distribution found for plt " I need help :/ pls
Can anybody give me some hints on how to put text(respective year in my case) in the stacked bars of histogram. I have a series of stock's return (1900-2020).
Hey When I use csv instead pandas that time my x axes values are overlap but when i use pandas that time everything is good what is reason behind that can any one explain me
I ended up with using URL instead of file name. Here it is. I hope it'll be helpful to you: data = pd.read_csv('raw.githubusercontent.com/CoreyMSchafer/code_snippets/master/Python/Matplotlib/06-Histograms/data.csv')
Im getting error in this video To verify i cant see code from top to bottom Before ending video , you should show complete code of the file.... for people like us.
hello, kindly note that in such cases you should clarify what error you are experiencing, so that someone can help you. also note that in the description of the video there is a link to his github page where he places the .csv file he uses in these tutorials, the initial code of the tutorial and also the final code.
Great series mate. Just top notch. Question, why didn't you just compute the median age rather than hard coding it? ages.median() would have done the trick since it's a pandas data object.
I'm new to this world. And I'm not able to understand this error. I went through the code exactly like above. Infact I copy pasted as well. But I'm constantly getting this error: KeyError: 'Responder_id' Can someone help pls? Mr. Schafer if you could please?
@@coreyms Okay I see. Actually I tried a lot. But it just download as data.html.csv on my Mac. So I manually copied and created one. Perhaps this is where the error lies. Thanks a lot sir. But sadly not able to download the file.
@@dhananjaykansal8097 I ran into a similar problem and I found out that you can use pd.read_csv to get the data directly from a webpage instead of a local folder. For example, you can go to Corey's github for this video, click on the data file, click on raw, then copy the html link for the page you're on. Use this html link inside pd.read_csv and you'll be able to get the data. 😊
I hope everyone finds this video helpful. The next video of the series will be posted tomorrow at the same time. The next video will cover how to create scatter plots. We will use UA-cam API data to plot views/likes from trending videos. We will also learn how to use color and size to add even more information to our plots, so be sure to check that out.
I'd like to thank Brilliant for sponsoring this series. If you'd like to check them out then you can sign up with this link and get 20% off your premium subscription:
brilliant.org/cms
Sir can you give me a rough idea of the dates when you will start with pandas and numpy!!Please sir
I am really desperate to know that! THANKS
That's interesting.
@@SHUBHITTALUSBIS I've already started working on the material, but I don't know exactly when they'll be released. It takes a long time to put together an entire series, so it could be another month or two until I'm finished with those. I'll be releasing individual video in the meantime as well.
Corey Schafer great videos!! Can you let me know how to add value/count on each bar? Just in case if the count is almost similar it would be difficult to differentiate which bin has higher or lesser count..
I find these series very useful, tahnks Corey, you, are best
Your courses are pure perfection. Excellently well thought, you just find a solution for every point I think of while the video is playing, you just get the answer for it in a simple smart way. Extremely well prepared, flawless presentations. I can't thank you enough.
Hey! Same here , thats what i'm about to comment😹.
Corey U r the best♥️.
Corey, I just recently started using matplotlib a lot and noticed you have lately uploaded its tutorials. Thanks man.
Could you do a tutorial on Seaborn please?
Thank you.
@Corey you are the best, am gonna leave a thank you on my portfolio in your name
Thank you so much for including real-life data!!!!
Lifesaver video for my engr class, I was having trouble with defining bins, and this helped me understand better
Thanks man. I was trying to understand this from Datacamp, which is PAID service... but I had to come to UA-cam, which is FREE to get the explanation that I wanted. Thank you and please keep up this great work.
Very well explained I got confused in the bin attribute, you made my day.😇😇😇😇
you have done a great job. I'm fully confident now to use plots in different styles.
Thank you again for these amazing, useful videos!
Great video and u teaches as simple as easy way . We can easily understand. Every topic u saws us with all options and deeply. Great work.
perfection at its best !
for people who suffered with the csv file: copy the file to a text file, then use the following code to remove the "
file_handle = open('New Text Document.txt')
for line in file_handle:
line.replace('"', '') # replace " with '' which is empty string
after that copy the New Text Document to any CSV file you have and name it data
Thank you for publishing this. I've been working through histograms with huge data sets at work and this really helps me identify what is really needed to simply produce helpful charts.
Hey Corey, great fan here It really took me many months to find a channel where the concepts were explained so well. Keep up the good work!
p.s Would you consider making a series on numpy and ai?
no
very useful series. thanks a lot. I really like the way u throw the things out.
sorry i have a question
when i installing the package " plt" .
That is displayed
" ERROR: Could not find a version that satisfies the requirement plt (from versions: none)
ERROR: No matching distribution found for plt
"
I need help :/ pls
Hii corey..your videos are really helpful...it makes everything so easy and makes programming fun...
Thanks for a great lesson on histogram.
thank you so much, great explanation. Helped me so much!
Holy shit! You're great, man! Very useful series 👍
Love your tutorials ! Thank you!!!!!
Amazing video!!
bins = [x for x in range(10, 101, 10)]
bins = list(range(10, 101, 10))
Great video 'our python hero"
I love your channel, thanks Corey!
Nice video!
Thank you this really helped me out
THANKS!!! I love your videos.
Thank you! This helped me
The best!!
Great tutorial . So clear explanation
Thanks man!!
thank you
legend
Hey Corey, really loving this series. Eagerly looking forward to the timeseries plot video.
My question is is it possible to plot aliases for the bins? To clarify say we had three bins which are predefined and instead of showing the ranges of the bins we want to plot 'low', 'medium' and 'high' as the alias of sorts. I think something similarly was done in the bar charts video.
Once again I love all your work not just this series.
Yes, you should be able to use the xticks method and pass in your own labels. You can find the xticks docs here:
matplotlib.org/3.1.0/api/_as_gen/matplotlib.pyplot.xticks.html
thanks ❤️
A big thank you for your videos. I have done a small change, correct me if I am wrong. I am a beginner. I imported statistics, and for median_age I used ;
median_age=sorted(data["Age"]) [ len(data["Age"])//2]
no, you should find sum of all ages, divide by total number of ages, and the result will be your median age
s = 0
for i in range(0, len(ids)):
s = s + ages[i]
s = s // len(ids)
Hi Corey, truly, only you can make a histogram video so interesting! On the logarithmic scale, how would you add the count labels to each bar on the graphs? Thank you!
no
07:56
Responder_id 10 missing 😝
Interesting videos 🤔👌:-)
Great Video, thanks for uploading. Quick question :- Can we define overflow and underflow bins in Python similar to Excel?
hey, great video, just wanna ask you what is the diffrence between range and bins of a hist ?
thank you in advance
thanks for the awesome videos Corey, you are awesome!!
by the way, what are your thoughts on VScode vs Sublime 3?? will you continue being faithful to sublime text?
saludos desde Chile amigo!
I have been using VSCode for daily coding since it has so many nice features, but I will likely use Sublime for videos because I find it to be much more minimalist and less distracting.
While I appreciate all the course and amazing level of detail in which you have explained. It would've been so much better if there was just 1 dataset that you used to show all the charts, or at least only a couple of variations.
Could you Create series on Data and Structures?
Hi Corey,
first I am a big fan of your tutorials. I have learned most of my Python skills by them.
At 7:00 you want to remove the 10-20 value from the histogram and just deleted the value in the list. I prefer to keep the original data as it is and use list funcionality bins=bins[1:] (plt.hist(ages, bins=bins[1:], edgecolor='black')) to remove values from the x-axis. Do I get something wrong or do you have a specific reason to do it your way?
what you are doing is fine, as long as it runs for this specific purpose. I guess that he did it that way just to keep it as simple as possible for educational purposes
Could you tell me how you make multiple command lines to comment (with #)?
How did you work out the median ?
Hi Corey, I wanted to know if it is possible to label every tick. For example can you put labels for ages 30, 50, 70, 90?
recommend
Is it possible to change the color of each bin individually?
i have an x axys that goes from 0 to 160, how can i put 160 bins without typying [1, 2, 3, 4, 5, ...., 160]??
Data which you have used is not in the description
How do I download your csv file? Or, can you make the csv file downloadable?
Why did you create new variables of age and id?
I wrote the code verbatim, but no histogram showed up. It ran without issue though...
Any tips on how to do this with excel sheets saved as cvs files? Any resources I could look at?
Hey corey, thanks for these awesome videos. But I am not able to download the data.csv file from github
sir, how to input different colors for different bins in one plot of histogram? any codes? please help me?
sorry i have a question
when i installing the package " plt" .
That is displayed
" ERROR: Could not find a version that satisfies the requirement plt (from versions: none)
ERROR: No matching distribution found for plt
"
I need help :/ pls
I think you have to update your Python version
Can I know, how to calculate the bin size of histogram?
import pandas as pd
import matplotlib.pyplot as plt
ages = [1,11,13,14,21,34,78,90,23,24,45,65,53, 55,62,70,71,72,82,22,27]
age_grp= [0,10,20,30,40,50,60,70,80,90,100]
plt.hist(ages, age_grp, rwidth=0.8, color='yellow',histtype='bar',alpha=0.5,edgecolor='black',)
plt.xticks(age_grp)
plt.style.use('fivethirtyeight')
plt.title('Age of the People who submitted their feedback')
plt.xlabel('Age Range')
plt.ylabel('People Count')
plt.tight_layout()
plt.show()
print('Bin sizes: {}'.format()
I can't find the ID and ages data on GitHub website. any help?
Can anybody give me some hints on how to put text(respective year in my case) in the stacked bars of histogram. I have a series of stock's return (1900-2020).
i got a question why you didn't use plt.hist(ids, bins=bins)
how come "plt.hist" passed 'ages' into 'ids'????
Hey When I use csv instead pandas that time my x axes values are overlap but when i use pandas that time everything is good
what is reason behind that can any one explain me
how to add the number of average line?
Hello, people.
Does anyone know how to express the frequencies in terms of percentages relative to the total amount of observations in the data set?
I couldn't download data.csv file. Alt+left clic gives me html format file :(
Any ideas, how I can do it correctly?
I ended up with using URL instead of file name. Here it is. I hope it'll be helpful to you:
data = pd.read_csv('raw.githubusercontent.com/CoreyMSchafer/code_snippets/master/Python/Matplotlib/06-Histograms/data.csv')
Go to GitHub click on data.csv ->Click on *raw* and then Ctrl+s and save it to your desired location.
I pasted them into a text file and then imported it to the CSV, may not seem practical but it's never bad to keep the data
Can anyone suggest a data set on which I can apply the things I learnt in this video?
Im getting error in this video
To verify i cant see code from top to bottom
Before ending video , you should show complete code of the file.... for people like us.
hello,
kindly note that in such cases you should clarify what error you are experiencing, so that someone can help you.
also note that in the description of the video there is a link to his github page where he places the .csv file he uses in these tutorials, the initial code of the tutorial and also the final code.
17586 views and 586 likes. Does it hurt to give a thumbs up?
Great series mate. Just top notch. Question, why didn't you just compute the median age rather than hard coding it? ages.median() would have done the trick since it's a pandas data object.
the thing says the code is fine but no plots are showing up
Where's the csv file of Responder_id, Age?
The lack of nonagenarian programmers is worrying.
I'm new to this world. And I'm not able to understand this error. I went through the code exactly like above. Infact I copy pasted as well. But I'm constantly getting this error:
KeyError: 'Responder_id'
Can someone help pls? Mr. Schafer if you could please?
Did you download the CSV file as well? That is what contains that key.
@@coreyms Okay I see. Actually I tried a lot. But it just download as data.html.csv on my Mac. So I manually copied and created one. Perhaps this is where the error lies. Thanks a lot sir. But sadly not able to download the file.
@@dhananjaykansal8097 I ran into a similar problem and I found out that you can use pd.read_csv to get the data directly from a webpage instead of a local folder.
For example, you can go to Corey's github for this video, click on the data file, click on raw, then copy the html link for the page you're on. Use this html link inside pd.read_csv and you'll be able to get the data. 😊
@@BiancaAguglia Thanks a ton. I'm gonna try this.
Jesus, 699 likes and 0 dislikes!
Got that 700th like
There are 6 dislikes. Probably 6 professors who are insecure about your lecture. :D
bu hayat insanazor
Anybody has a jupyter notebook version of his code? And if you would like to share, please comment.
programmers aged between 100 and 110 are feeling offended
Who disliked this video?
only 1 person disliked:)
Yeah!