- Hands-On Data Science and Python Machine Learning
- Frank Kane
- 246字
- 2021-07-15 17:15:07
Mean
The mean, as you probably know, is just another name for the average. To calculate the mean of a dataset, all you have to do is sum up all the values and divide it by the number of values that you have.
Let's take this example, which calculates the mean (average) number of children per house in my neighborhood.
Let's say I went door-to-door in my neighborhood and asked everyone, how many children live in their household. (That, by the way, is a good example of discrete numerical data; remember from the previous section?) Let's say I go around and I found out that the first house has no kids in it, and the second house has two children, and the third household has three children, and so on and so forth. I amassed this little dataset of discrete numerical data, and to figure out the mean, all I do is add them all together and divide it by the number of houses that I went to.
Number of children in each house on my street:
0, 2, 3, 2, 1, 0, 0, 2, 0
The mean is (0+2+3+2+1+0+0+2+0)/9 = 1.11
It comes out as 0 plus 2 plus 3 plus all the rest of these numbers divided by the total number of houses that I looked at, which is 9, and the mean number of children per house in my sample is 1.11. So, there you have it, mean.
- .NET之美:.NET關(guān)鍵技術(shù)深入解析
- C# 從入門到項目實踐(超值版)
- Django Design Patterns and Best Practices
- 高級C/C++編譯技術(shù)(典藏版)
- C#程序設(shè)計
- C#程序設(shè)計基礎(chǔ):教程、實驗、習(xí)題
- Oracle從入門到精通(第5版)
- R Data Analysis Cookbook(Second Edition)
- Visual Basic程序設(shè)計實踐教程
- 從0到1:HTML5 Canvas動畫開發(fā)
- Julia High Performance(Second Edition)
- Scrapy網(wǎng)絡(luò)爬蟲實戰(zhàn)
- 例解Python:Python編程快速入門踐行指南
- 軟件設(shè)計模式(Java版)
- HTML5 and CSS3:Building Responsive Websites