Overview — What Are Measures of Central Tendency?Overview — Measures of Central Tendency क्या हैं?概览 — 什么是集中趋势的度量?
In statistics, a measure of central tendency is one value that summarises a dataset by showing where its centre lies. The three most common measures are:
Statistics में measure of central tendency एक ऐसी value है जो बताती है कि dataset का केंद्र कहाँ है, और पूरे data का सार देती है। तीन सबसे आम measures ये हैं:
在统计学中,集中趋势的度量是用一个值来概括数据集,指出数据的中心在哪里。最常用的三种度量是:
- Sum ÷ Countजोड़ ÷ गिनती总和 ÷ 个数
- Pulled by outliersOutliers से खिंचता है会被离群点拉偏
- Best for symmetric dataSymmetric data के लिए सबसे अच्छा最适合对称数据
- Middle value (sorted)बीच की value (sort के बाद)排序后的中间值
- Resists outliersOutliers का असर कम抗离群点
- Best for skewed dataSkewed data के लिए सबसे अच्छा最适合偏斜数据
- Most frequent valueसबसे ज़्यादा बार आने वाली value出现最多的值
- Works on categoriesCategories पर भी चलता है适用于类别数据
- Can be 0, 1 or many values0, 1 या कई values हो सकती हैं可以有 0 个、1 个或多个
Choosing the wrong measure can completely mislead your analysis. Reporting the average income of a country with large inequality gives a false picture — the median is far more honest.
ग़लत measure चुनने से आपका पूरा analysis गुमराह हो सकता है। बहुत असमानता वाले देश की average income बताना झूठी तस्वीर देता है — median कहीं ज़्यादा ईमानदार है।
选错度量会彻底误导你的分析。在贫富差距很大的国家报告平均收入,会给出虚假的印象 —— 中位数要诚实得多。
The Mean (Arithmetic Average)Mean (Arithmetic Average)均值(算术平均数)
The mean is found by adding all values and dividing by how many there are. It uses every single value in the dataset — which makes it powerful, but also easy to pull by extreme values (outliers).
Mean निकालने के लिए सभी values जोड़कर उनकी गिनती से भाग देते हैं। यह dataset की हर एक value इस्तेमाल करता है — इसलिए ताक़तवर है, पर extreme values (outliers) इसे आसानी से खींच लेते हैं।
均值就是把所有值相加,再除以个数。它用到了数据集中的每一个值 —— 这让它很有力,但也很容易被极端值(离群点)拉偏。
FormulaFormula公式
N = population size
N = population size
N = 总体大小
n = sample size (a subset of the data)
n = sample size (data का एक हिस्सा)
n = 样本大小(数据的一个子集)
Click on the beam to add a point, click a point to remove it, and drag the triangle (fulcrum). The beam only balances when the fulcrum is exactly at the mean, because then Σ(x − mean) = 0.
Point जोड़ने के लिए beam पर click करें, हटाने के लिए point पर click करें, और त्रिकोण (fulcrum) को खींचें। Beam तभी संतुलित होता है जब fulcrum ठीक mean पर हो, क्योंकि तब Σ(x − mean) = 0.
点击横梁添加一个点,点击某个点删除它,拖动三角形(支点)。只有支点正好在均值处时横梁才平衡,因为此时 Σ(x − 均值) = 0。
Real Example — Employee Salariesअसली उदाहरण — कर्मचारियों की Salaries真实例子 — 员工工资
A small company has 10 employees with these monthly salaries (₹):
एक छोटी company में 10 कर्मचारी हैं, जिनकी monthly salaries (₹) ये हैं:
一家小公司有 10 名员工,月薪(₹)如下:
| Emp #Emp #员工编号 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |
|---|---|---|---|---|---|---|---|---|---|---|
| Salary (₹)Salary (₹)工资(₹) | 32,000 | 35,000 | 37,000 | 38,000 | 40,000 | 42,000 | 45,000 | 47,000 | 50,000 | 54,000 |
32,000 + 35,000 + 37,000 + 38,000 + 40,000 + 42,000 + 45,000 + 47,000 + 50,000 + 54,000 = ₹4,20,000
32,000 + 35,000 + 37,000 + 38,000 + 40,000 + 42,000 + 45,000 + 47,000 + 50,000 + 54,000 = ₹4,20,000
32,000 + 35,000 + 37,000 + 38,000 + 40,000 + 42,000 + 45,000 + 47,000 + 50,000 + 54,000 = ₹4,20,000
x̄ = 4,20,000 / 10 = ₹42,000
x̄ = 4,20,000 / 10 = ₹42,000
x̄ = 4,20,000 / 10 = ₹42,000
The Outlier Problem — When the Mean FailsOutlier की समस्या — जब Mean फ़ेल होता है离群点问题 — 均值失灵的时候
Now the CEO joins with a salary of ₹5,00,000/month:
अब CEO ₹5,00,000/महीना की salary के साथ जुड़ता है:
现在 CEO 加入,月薪 ₹5,00,000:
New sum = 4,20,000 + 5,00,000 = ₹9,20,000
New mean = 9,20,000 / 11 = ₹83,636/month
But 10 of the 11 employees earn ₹32,000–₹54,000! ₹83,636 does NOT describe a typical salary. The median only moves from ₹41,000 to ₹42,000. This is why salary surveys usually report the median.
नया जोड़ = 4,20,000 + 5,00,000 = ₹9,20,000
नया mean = 9,20,000 / 11 = ₹83,636/महीना
पर 11 में से 10 कर्मचारी ₹32,000–₹54,000 कमाते हैं! ₹83,636 आम salary नहीं बताता। Median सिर्फ़ ₹41,000 से ₹42,000 होता है। इसीलिए salary surveys आमतौर पर median बताते हैं।
新的总和 = 4,20,000 + 5,00,000 = ₹9,20,000
新的均值 = 9,20,000 / 11 = ₹83,636/月
可 11 人中有 10 人的工资在 ₹32,000–₹54,000 之间!₹83,636 并不代表典型工资。中位数只从 ₹41,000 变成 ₹42,000。这就是工资调查通常报告中位数的原因。
The ten salaries above (grey). Tick the box and move the slider to set the CEO salary. Blue = mean, green = median.
ऊपर की दस salaries (स्लेटी)। Box पर tick करें और CEO की salary set करने के लिए slider खिसकाएँ। नीला = mean, हरा = median.
上面的十个工资(灰色)。勾选复选框并拖动滑块设置 CEO 工资。蓝色 = 均值,绿色 = 中位数。
Python CodePython CodePython 代码
import numpy as np
salaries = [32000, 35000, 37000, 38000, 40000,
42000, 45000, 47000, 50000, 54000]
print("Mean (no CEO) :", np.mean(salaries))
print("Median (no CEO) :", np.median(salaries))
salaries_with_ceo = salaries + [500000]
print("Mean (with CEO):", round(np.mean(salaries_with_ceo), 2))
print("Median (with CEO):", np.median(salaries_with_ceo))Industry Applications of the MeanMean के Industry Applications均值的行业应用
| IndustryIndustry行业 | Applicationइस्तेमाल应用 |
|---|---|
| 💰 FinanceFinance金融 | Average daily stock return, average monthly expensesStock का औसत daily return, औसत monthly ख़र्च股票平均日收益、平均月支出 |
| 🏭 ManufacturingManufacturing制造业 | Average product weight, average defect rate per batchProduct का औसत वज़न, हर batch की औसत defect rate产品平均重量、每批平均次品率 |
| 🏥 HealthcareHealthcare医疗 | Average blood pressure in a trial group, average daily bed occupancyTrial group का औसत blood pressure, रोज़ की औसत bed occupancy试验组平均血压、每日平均床位占用 |
| 🎓 EducationEducation教育 | Average test score across a classClass का औसत test score全班平均分 |
| 🛒 E-commerceE-commerce电商 | Average order value (AOV) — check the median too, because a few big orders pull it upAverage order value (AOV) — median भी देखें, क्योंकि कुछ बड़े orders इसे ऊपर खींचते हैं平均订单金额(AOV)—— 也要看中位数,因为少数大单会把它拉高 |
When to Use the MeanMean कब इस्तेमाल करें何时使用均值
- Data is roughly symmetric (for example bell-shaped)Data लगभग symmetric हो (जैसे bell-shaped)数据大致对称(比如钟形)
- No important outliersकोई बड़े outliers न हों没有明显的离群点
- Values are numeric (height, weight, temperature, exam scores)Values numeric हों (ऊँचाई, वज़न, तापमान, exam scores)数值型数据(身高、体重、温度、考试分数)
- You need the value for further calculations (standard deviation, regression)आगे की गणनाओं में value चाहिए (standard deviation, regression)需要用于后续计算(标准差、回归)
The Median (Middle Value)Median (बीच की Value)中位数(中间值)
The median is the middle value of the sorted data: half of the values are below it and half are above. Because it depends on position, not size, making the largest value even larger does not change it at all.
Median sort किए data की बीच की value है: आधी values उससे नीचे और आधी ऊपर। क्योंकि यह position पर निर्भर है, आकार पर नहीं, सबसे बड़ी value को और बड़ा करने से यह बिल्कुल नहीं बदलता।
中位数是排序后数据的中间值:一半的值在它下面,一半在上面。因为它取决于位置而不是大小,把最大值变得再大,它也完全不变。
FormulaFormula公式
e.g. n = 9 → position 5
जैसे n = 9 → position 5
例:n = 9 → 第 5 个
e.g. n = 10 → average positions 5 and 6
जैसे n = 10 → position 5 और 6 का औसत
例:n = 10 → 第 5 和第 6 个的平均
Make a new odd or even list, add a huge number, then press "Sort & find the median". The huge number changes the mean a lot but the median very little.
नई odd या even list बनाएँ, एक बहुत बड़ा number जोड़ें, फिर "Sort करें और median खोजें" दबाएँ। बड़ा number mean को बहुत बदलता है पर median को बहुत कम।
生成新的奇数或偶数列表,加入一个超大的数,然后点击“排序并找中位数”。超大的数会大幅改变均值,却几乎不影响中位数。
Real Example — House Prices in a Cityअसली उदाहरण — एक शहर में घरों के दाम真实例子 — 某城市的房价
Seven properties recently sold in a neighbourhood (₹ lakh):
एक इलाके में हाल ही में बिकी सात properties (₹ लाख):
某街区最近售出的七套房产(₹ 拉克):
| PropertyProperty房产 | A | B | C | D | E | F | Luxury VillaLuxury Villa豪华别墅 |
|---|---|---|---|---|---|---|---|
| Price (₹L)दाम (₹L)价格(₹L) | 45 | 52 | 47 | 55 | 50 | 48 | 420 |
Income is the classic right-skewed variable. For example, the US Census Bureau reports a median household income of $83,730 for 2024. The mean household income is well above the median, because a small number of very high incomes pull the mean up — which is exactly why official reports lead with the median.
Income सबसे आम right-skewed variable है। उदाहरण के लिए, US Census Bureau ने 2024 की median household income $83,730 बताई है। Mean household income median से काफ़ी ऊपर है, क्योंकि कुछ बहुत ऊँची incomes mean को ऊपर खींचती हैं — इसीलिए official reports median को आगे रखती हैं।
收入是典型的右偏变量。例如,美国人口普查局公布 2024 年家庭收入中位数为 $83,730。家庭收入的均值明显高于中位数,因为少数极高收入把均值拉高了 —— 这正是官方报告首先给出中位数的原因。
Python CodePython CodePython 代码
import numpy as np
house_prices = [45, 52, 47, 55, 50, 48, 420] # ₹ lakh
print("Sorted:", sorted(house_prices))
print("Mean :", round(np.mean(house_prices), 2)) # pulled up by the villa
print("Median:", np.median(house_prices)) # the typical homeIndustry Applications of the MedianMedian के Industry Applications中位数的行业应用
| IndustryIndustry行业 | Applicationइस्तेमाल应用 |
|---|---|
| 🏠 Real EstateReal Estate房地产 | Median home price in a city (the standard measure)शहर में घर का median दाम (standard measure)城市房价中位数(标准指标) |
| 📊 EconomicsEconomics经济学 | Median household income, median net worthMedian household income, median net worth家庭收入中位数、净资产中位数 |
| 🏥 HealthcareHealthcare医疗 | Median survival time in clinical trialsClinical trials में median survival time临床试验中的中位生存期 |
| 💼 HR / RecruitmentHR / Recruitment人力 / 招聘 | Median salary for a job role — fairer than the meanकिसी job role की median salary — mean से ज़्यादा उचित岗位工资中位数 —— 比均值更公平 |
| 🚚 LogisticsLogistics物流 | Median delivery time — not pulled by rare extreme delaysMedian delivery time — कभी-कभार की बहुत लंबी देरी से नहीं खिंचता配送时间中位数 —— 不受偶发极端延误影响 |
When to Use the MedianMedian कब इस्तेमाल करें何时使用中位数
- Data is skewed (income, property prices, wealth)Data skewed हो (income, property prices, दौलत)数据偏斜(收入、房价、财富)
- Important outliers are presentबड़े outliers मौजूद हों存在明显的离群点
- Ordinal data — values have an order but unequal gaps (e.g. ratings 1–5)Ordinal data — values का क्रम है पर अंतर बराबर नहीं (जैसे ratings 1–5)有序数据 —— 有先后顺序但间隔不相等(如 1–5 分评分)
- You want the typical experience, not a mathematical averageआपको गणित वाला average नहीं, आम अनुभव चाहिए你想描述典型情况,而不是数学平均
The Mode (Most Frequent Value)Mode (सबसे ज़्यादा बार आने वाली Value)众数(出现最多的值)
The mode is the value that appears most often. Unlike the mean and median, it also works on categorical (non-numeric) data. A dataset can have one mode, two modes (bimodal), several modes, or no mode.
Mode वह value है जो सबसे ज़्यादा बार आती है। Mean और median के उलट, यह categorical (बिना number वाले) data पर भी चलता है। Dataset में एक mode, दो modes (bimodal), कई modes, या कोई mode नहीं भी हो सकता।
众数是出现次数最多的值。与均值和中位数不同,它也适用于类别型(非数值)数据。一个数据集可以有一个众数、两个众数(双峰)、多个众数,或者没有众数。
Simply: the value that occurs most.
आसान शब्दों में: सबसे ज़्यादा आने वाली value.
简单说:出现最多的值。
These are the two datasets below. Click any bar to add one more customer or vote; the crown moves to the most frequent value. Try "Make it bimodal".
ये नीचे के दोनों datasets हैं। एक और customer या vote जोड़ने के लिए किसी bar पर click करें; crown सबसे ज़्यादा बार आने वाली value पर जाता है। "इसे bimodal बनाएँ" आज़माएँ।
就是下面的两个数据集。点击任意柱子再加一位顾客或一票,皇冠会移到出现最多的值上。试试“变成双峰”。
Real Example — Retail Shoe Storeअसली उदाहरण — जूतों की दुकान真实例子 — 鞋店
A shoe store records the sizes bought by 238 customers to decide which size to order most:
एक जूतों की दुकान 238 customers के ख़रीदे sizes लिखती है, ताकि तय कर सके कि कौन सा size सबसे ज़्यादा मँगाना है:
一家鞋店记录了 238 位顾客购买的尺码,以决定哪个尺码进货最多:
| SizeSize尺码 | 6 | 6.5 | 7 | 7.5 | 8 | 8.5 ★ | 9 | 9.5 | 10 | 10.5 | 11 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| CustomersCustomers顾客数 | 5 | 8 | 15 | 22 | 38 | 45 | 40 | 30 | 20 | 10 | 5 |
Mode = size 8.5 — bought by 45 customers, the highest frequency.
The mode is the measure that tells the store most directly: order the most 8.5s! (Here the mean size is 8.6 and the median is 8.5 — close, but a size of "8.6" does not exist on the shelf.)
Mode = size 8.5 — 45 customers ने ख़रीदा, सबसे ज़्यादा frequency.
Mode वह measure है जो दुकान को सीधे बताता है: सबसे ज़्यादा 8.5 मँगाओ! (यहाँ mean size 8.6 और median 8.5 है — पास-पास, पर shelf पर "8.6" size होता ही नहीं।)
众数 = 8.5 码 —— 45 位顾客购买,频数最高。
众数最直接地告诉商店:8.5 码进货最多!(这里均值尺码是 8.6,中位数是 8.5 —— 很接近,但货架上根本没有“8.6 码”。)
Real Example — Favourite Colour Survey (Categorical Data)असली उदाहरण — पसंदीदा रंग Survey (Categorical Data)真实例子 — 最喜欢的颜色调查(类别数据)
A school asks 200 students: "What is your favourite colour?"
एक school 200 students से पूछता है: "आपका पसंदीदा रंग क्या है?"
一所学校问 200 名学生:“你最喜欢什么颜色?”
| Blue ★Blue ★蓝色 ★ | RedRed红色 | GreenGreen绿色 | YellowYellow黄色 | PurplePurple紫色 | OrangeOrange橙色 |
|---|---|---|---|---|---|
| 72 | 58 | 35 | 18 | 12 | 5 |
You cannot calculate a mean or median of colours — they are categories, not numbers, and they have no natural order. Mode = Blue is the only valid measure. Always check the data type before choosing a measure.
रंगों का mean या median नहीं निकाला जा सकता — ये categories हैं, numbers नहीं, और इनका कोई स्वाभाविक क्रम नहीं है। Mode = Blue ही अकेला सही measure है। Measure चुनने से पहले हमेशा data type जाँचें।
颜色无法求均值或中位数 —— 它们是类别而不是数字,也没有自然顺序。众数 = 蓝色是唯一有效的度量。选择度量之前,一定先检查数据类型。
Unimodal, Bimodal and MultimodalUnimodal, Bimodal और Multimodal单峰、双峰与多峰
| Typeप्रकार类型 | Definitionपरिभाषा定义 | Exampleउदाहरण例子 |
|---|---|---|
| Unimodal | One peak / one modeएक peak / एक mode一个峰 / 一个众数 | Exam scores clustered around 7070 के आसपास जमा exam scores集中在 70 分左右的考试成绩 |
| Bimodal | Two peaks / two modesदो peaks / दो modes两个峰 / 两个众数 | Customer ages with peaks at 25 and 55; product reviews with many 1★ and many 5★25 और 55 पर peaks वाली customer ages; बहुत सारे 1★ और 5★ वाले product reviews在 25 岁和 55 岁各有一个高峰的顾客年龄;大量 1 星和 5 星并存的商品评价 |
| Multimodal | Three or more peaksतीन या ज़्यादा peaks三个或更多峰 | Restaurant orders by hour: breakfast, lunch and dinner peaksघंटे के हिसाब से restaurant orders: breakfast, lunch और dinner के peaks按小时统计的餐厅订单:早餐、午餐、晚餐三个高峰 |
| No Modeकोई Mode नहीं无众数 | All values equally frequentसभी values बराबर बार所有值出现次数相同 | The theoretical outcomes of a fair die (each face has probability 1/6)Fair die के theoretical नतीजे (हर face की probability 1/6)公平骰子的理论结果(每一面的概率都是 1/6) |
Python CodePython CodePython 代码
import numpy as np
from collections import Counter
from scipy import stats
shoe_sizes = [6, 6.5, 7, 7.5, 8, 8.5, 9, 9.5, 10, 10.5, 11]
counts = [5, 8, 15, 22, 38, 45, 40, 30, 20, 10, 5]
data = np.repeat(shoe_sizes, counts) # one entry per customer
print("Customers:", len(data))
print("Mode :", stats.mode(data).mode) # newer SciPy returns a single value
# Categorical data: SciPy's mode needs numbers, so use Counter (or pandas)
colours = (["Blue"] * 72 + ["Red"] * 58 + ["Green"] * 35 +
["Yellow"] * 18 + ["Purple"] * 12 + ["Orange"] * 5)
print("Favourite:", Counter(colours).most_common(1))(1) In SciPy 1.11 and later, stats.mode(...).mode is a single value, so old code with .mode[0] crashes. (2) SciPy's mode only accepts numbers; for text use collections.Counter, statistics.multimode or pandas .mode().
(1) SciPy 1.11 और बाद में stats.mode(...).mode एक ही value है, इसलिए .mode[0] वाला पुराना code crash हो जाता है। (2) SciPy का mode सिर्फ़ numbers लेता है; text के लिए collections.Counter, statistics.multimode या pandas .mode() इस्तेमाल करें।
(1) 在 SciPy 1.11 及以后版本中,stats.mode(...).mode 是单个值,所以带 .mode[0] 的旧代码会报错。(2) SciPy 的 mode 只接受数字;文本数据请用 collections.Counter、statistics.multimode 或 pandas 的 .mode()。
Industry Applications of the ModeMode के Industry Applications众数的行业应用
| IndustryIndustry行业 | Applicationइस्तेमाल应用 |
|---|---|
| 🛍️ RetailRetail零售 | Most popular size, colour or category to stockStock करने के लिए सबसे लोकप्रिय size, रंग या category最该备货的尺码、颜色或品类 |
| 📣 MarketingMarketing营销 | Most common customer age group, most popular channelसबसे आम customer age group, सबसे लोकप्रिय channel最常见的客户年龄段、最受欢迎的渠道 |
| 🏥 HealthcareHealthcare医疗 | Most common diagnosis, most frequently prescribed drugसबसे आम diagnosis, सबसे ज़्यादा लिखी जाने वाली दवा最常见的诊断、开得最多的药 |
| 🚗 TransportationTransportation交通 | Most popular route, most common trip length bandसबसे लोकप्रिय route, सबसे आम trip length band最热门的线路、最常见的行程距离区间 |
| 📱 Social MediaSocial Media社交媒体 | Most liked post type, most used hashtagसबसे ज़्यादा like होने वाला post type, सबसे ज़्यादा इस्तेमाल hashtag获赞最多的帖子类型、使用最多的话题标签 |
When to Use the ModeMode कब इस्तेमाल करें何时使用众数
- Data is categorical (colours, brands, yes/no, city names)Data categorical हो (रंग, brands, हाँ/ना, शहरों के नाम)数据是类别型(颜色、品牌、是/否、城市名)
- You need the most popular item or choiceआपको सबसे लोकप्रिय चीज़ या पसंद चाहिए需要找出最受欢迎的项目或选择
- Spotting groups in data (two peaks = maybe two different groups)Data में groups पहचानना (दो peaks = शायद दो अलग groups)发现数据中的群体(两个峰 = 可能有两个不同群体)
- Quality control — finding the most common defect typeQuality control — सबसे आम defect type खोजना质量控制 —— 找出最常见的缺陷类型
- Filling missing values in categorical ML columnsCategorical ML columns में missing values भरना填补类别型机器学习列中的缺失值
Skewness — How the Shape Changes EverythingSkewness — आकार सब कुछ कैसे बदलता है偏度 — 形状如何改变一切
The order of the mean, median and mode tells you the shape of a distribution. Understanding skewness helps you choose the right measure and avoid misleading reports.
Mean, median और mode का क्रम आपको distribution का आकार बताता है। Skewness समझने से सही measure चुनने और गुमराह करने वाली reports से बचने में मदद मिलती है।
均值、中位数和众数的先后顺序能告诉你分布的形状。理解偏度能帮你选对度量,避免做出误导性的报告。
━ meanmean均值 ━ medianmedian中位数 ━ modemode众数
Move the slider from left-skewed to right-skewed. The page draws 5,000 values with that shape and marks the mean, median and mode (the tallest bar).
Slider को left-skewed से right-skewed तक खिसकाएँ। Page उस आकार के 5,000 values बनाता है और mean, median और mode (सबसे ऊँची bar) दिखाता है।
把滑块从左偏拖到右偏。页面按这种形状生成 5,000 个值,并标出均值、中位数和众数(最高的柱子)。
| DistributionDistribution分布 | Shapeआकार形状 | Usual orderआम क्रम通常顺序 | Best measureसबसे अच्छा measure最佳度量 |
|---|---|---|---|
| SymmetricSymmetric对称 | Bell-shapedBell-shaped钟形 | Mean = Median = Mode | Any — all are equalकोई भी — सब बराबर都可以 —— 三者相等 |
| Right-skewed (+)Right-skewed (+)右偏(+) | Long tail on the rightदाईं ओर लंबी पूँछ右侧长尾 | Mode < Median < Mean | Median |
| Left-skewed (−)Left-skewed (−)左偏(−) | Long tail on the leftबाईं ओर लंबी पूँछ左侧长尾 | Mean < Median < Mode | Median |
For moderately skewed, single-peaked data:
Mean − Mode ≈ 3 × (Mean − Median)
This lets you estimate the mode from the mean and median. It is a rule of thumb, not a law: check it in the simulator above — it is close for mild skew and less accurate for strong skew.
मध्यम skewed, एक peak वाले data के लिए:
Mean − Mode ≈ 3 × (Mean − Median)
इससे mean और median से mode का अंदाज़ा लगाया जा सकता है। यह एक आम नियम है, कोई पक्का क़ानून नहीं: ऊपर के simulator में जाँचें — हल्के skew में यह पास रहता है और ज़्यादा skew में कम सटीक।
对中度偏斜、单峰的数据:
均值 − 众数 ≈ 3 × (均值 − 中位数)
可以用均值和中位数来估计众数。这是经验法则而不是定律:在上面的模拟器里验证一下 —— 轻度偏斜时很接近,偏斜严重时就不那么准了。
Complete Real Example — Student Exam Scoresपूरा असली उदाहरण — Students के Exam Scores完整真实例子 — 学生考试成绩
A class of 20 students takes a maths exam (out of 100). Here are their scores:
20 students की एक class maths का exam (100 में से) देती है। उनके scores ये हैं:
一个 20 人的班级参加数学考试(满分 100)。成绩如下:
| # | ScoreScore分数 | # | ScoreScore分数 | # | ScoreScore分数 | # | ScoreScore分数 | # | ScoreScore分数 |
|---|---|---|---|---|---|---|---|---|---|
| 1 | 45 | 5 | 60 | 9 | 65 | 13 | 72 | 17 | 85 |
| 2 | 52 | 6 | 60 | 10 | 65 | 14 | 75 | 18 | 80 |
| 3 | 55 | 7 | 62 | 11 | 65 | 15 | 78 | 19 | 88 |
| 4 | 58 | 8 | 62 | 12 | 68 | 16 | 70 | 20 | 92 |
…, 62, 65, 65, 65, 68, … → M = (65 + 65) / 2 = 65.0
…, 62, 65, 65, 65, 68, … → M = (65 + 65) / 2 = 65.0
…、62、65、65、65、68、… → M = (65 + 65) / 2 = 65.0
import numpy as np
import statistics as st
scores = [45, 52, 55, 58, 60, 60, 62, 62, 65, 65,
65, 68, 72, 75, 78, 70, 85, 80, 88, 92]
print("Sum :", sum(scores))
print("Mean :", np.mean(scores))
print("Median:", np.median(scores))
print("Modes :", st.multimode(scores)) # all values tied for most frequent
print("Sorted 10th and 11th:", sorted(scores)[9], sorted(scores)[10])What It Tells the TeacherTeacher को यह क्या बताता है这对老师意味着什么
| MeasureMeasure度量 | ValueValue值 | What it tells the teacherTeacher को क्या बताता है对老师的意义 |
|---|---|---|
| Mean | 67.85 | The average — useful to compare this class with other classes or past years.औसत — इस class की दूसरी classes या पिछले सालों से तुलना के लिए उपयोगी।平均分 —— 适合和其他班级或往年比较。 |
| Median | 65.0 | The typical student — half the class scored 65 or less, half 65 or more. Mean > median shows a mild right skew: a few high scores pull the mean up.आम student — आधी class के 65 या कम, आधी के 65 या ज़्यादा। Mean > median हल्का right skew दिखाता है: कुछ ऊँचे scores mean को ऊपर खींचते हैं।典型学生 —— 一半同学 65 分及以下,一半 65 分及以上。均值 > 中位数说明轻度右偏:少数高分把均值拉高了。 |
| Mode | 65 | The most common score — several students are bunched here; a natural target for revision support.सबसे आम score — कई students यहीं इकट्ठा हैं; revision support के लिए स्वाभाविक लक्ष्य।最常见的分数 —— 好几名学生集中在这里,是复习辅导的自然目标。 |
Decision Guide — Which Measure to Choose?Decision Guide — कौन सा Measure चुनें?决策指南 — 该选哪种度量?
| Situationस्थिति情况 | Use MeanMean लें用均值 | Use MedianMedian लें用中位数 | Use ModeMode लें用众数 |
|---|---|---|---|
| Data typeData type数据类型 | NumericNumeric数值型 | Numeric or ordinalNumeric या ordinal数值型或有序型 | Categorical or discreteCategorical या discrete类别型或离散型 |
| DistributionDistribution分布 | SymmetricSymmetric对称 | SkewedSkewed偏斜 | Anyकोई भी任意 |
| Outliers present?Outliers हैं?有离群点? | No outliersकोई outlier नहीं无离群点 | Outliers presentOutliers हैं有离群点 | Usually does not matterआमतौर पर फ़र्क़ नहीं通常无关紧要 |
| Goalलक्ष्य目的 | Further calculationsआगे की गणनाएँ后续计算 | Describe the typical valueआम value बताना描述典型值 | Find the most popular valueसबसे लोकप्रिय value खोजना找出最受欢迎的值 |
| Real exampleअसली उदाहरण实例 | Average temperatureऔसत तापमान平均气温 | Household incomeHousehold income家庭收入 | Most popular productसबसे लोकप्रिय product最畅销的产品 |
| ML imputationML imputation机器学习缺失值填补 | Roughly normal featuresलगभग normal features近似正态的特征 | Skewed featuresSkewed features偏斜特征 | Categorical columnsCategorical columns类别列 |
Missing values in ML — the same rule, in codeML में Missing Values — वही नियम, code में机器学习中的缺失值 — 同样的规则,用代码实现
import numpy as np
import pandas as pd
from sklearn.impute import SimpleImputer
df = pd.DataFrame({
'age': [25, 32, np.nan, 41, 29, 35], # roughly symmetric
'income': [30, 35, 32, np.nan, 38, 400], # ₹ thousand, skewed
'city': ['Delhi', 'Pune', 'Delhi', None, 'Delhi', 'Pune'],
})
print("Mean income :", df['income'].mean()) # pulled up by the 400
print("Median income:", df['income'].median())
df['age'] = SimpleImputer(strategy='mean').fit_transform(df[['age']]).ravel()
df['income'] = SimpleImputer(strategy='median').fit_transform(df[['income']]).ravel()
df['city'] = SimpleImputer(strategy='most_frequent').fit_transform(df[['city']]).ravel()
print(df)The income column shows why the rule matters: one income of 400 lifts the mean to 107, so mean imputation would invent a high earner. The median (35) gives a typical value.
Income column दिखाता है कि नियम क्यों ज़रूरी है: 400 की एक income mean को 107 तक ले जाती है, इसलिए mean imputation एक नक़ली ऊँची कमाई वाला बना देता। Median (35) आम value देता है।
收入列说明了这条规则为什么重要:一个 400 的收入把均值拉到 107,用均值填补就等于凭空造出一个高收入者。中位数(35)给出的才是典型值。
Read each situation, pick a measure, and read why. Your score is shown at the top.
हर स्थिति पढ़ें, एक measure चुनें, और वजह पढ़ें। आपका score ऊपर दिखता है।
阅读每个场景,选择一种度量,再看解释。得分显示在上方。
Quick Reference CardQuick Reference Card速查卡
| Propertyगुण特性 | Mean | Median | Mode |
|---|---|---|---|
| SymbolSymbol符号 | x̄ / μ | M | Mo |
| FormulaFormula公式 | Σxᵢ / n | Middle value (sorted)बीच की value (sort के बाद)排序后的中间值 | Most frequent valueसबसे ज़्यादा बार आने वाली value出现最多的值 |
| Data typeData type数据类型 | Numeric onlyसिर्फ़ numeric仅数值型 | Numeric or ordinalNumeric या ordinal数值型或有序型 | Any (incl. categorical)कोई भी (categorical समेत)任意(含类别型) |
| Outlier effect?Outlier का असर?受离群点影响? | Yes — stronglyहाँ — बहुत是 —— 很大 | Little — robustकम — मज़बूत很小 —— 稳健 | Usually noneआमतौर पर नहीं通常没有 |
| Always one value?हमेशा एक value?总是唯一? | Always 1 valueहमेशा 1 value总是 1 个值 | Always 1 valueहमेशा 1 value总是 1 个值 | 0, 1 or many0, 1 या कई0 个、1 个或多个 |
| Skewed dataSkewed data偏斜数据 | Misleadingगुमराह करता है会误导 | Reliableभरोसेमंद可靠 | Dependsनिर्भर करता है视情况而定 |
| Used in standard deviation?Standard deviation में इस्तेमाल?用于计算标准差? | Yesहाँ是 | Noनहीं否 | Noनहीं否 |
| Real estateReal estate房地产 | Avoidबचें避免 | Standard useStandard इस्तेमाल标准用法 | Rareकम ही少用 |
| Income reportingIncome reporting收入报告 | Report with care (alongside the median)सावधानी से (median के साथ)谨慎使用(与中位数一起报告) | Preferredपसंदीदा首选 | Income bandsIncome bands收入区间 |
| ML imputationML imputation机器学习填补 | Roughly normal featuresलगभग normal features近似正态特征 | Skewed featuresSkewed features偏斜特征 | Categorical featuresCategorical features类别特征 |