Data और Statistics समझना
Data क्या है?
Data किसी चीज़ के बारे में दर्ज कच्चे तथ्यों – numbers, text, images, sounds – का संग्रह है। जब data को व्यवस्थित और process करके अर्थपूर्ण बनाया जाता है तो उसे information कहते हैं। Schools, banks, hospitals और apps सभी data के आधार पर फ़ैसले लेते हैं।
Structured vs unstructured
Structured data
- Rows और columns में व्यवस्थित
- Fixed format (tables, spreadsheets, databases)
- Search और analyse करना आसान
- Example: marks sheet, railway reservation
Unstructured data
- कोई fixed format नहीं
- Text, images, audio, video, posts
- Analyse करने के लिए special tools चाहिए
- Example: emails, photos, YouTube videos
Data life cycle
- 1Collection – forms, sensors, surveys, websites से data इकट्ठा करना
- 2Storage – files, databases या cloud में save करना
- 3Processing – clean, sort, calculate, summarise
- 4Analysis और presentation – tables, charts, reports
- 5Decision – information का इस्तेमाल
Collection और storage
Data manually (registers, survey forms) या automatically (barcode scanners, sensors, online forms) इकट्ठा किया जा सकता है। इसे files (text, CSV), spreadsheets, databases (MySQL) या cloud storage में रखते हैं। Storage devices में HDD, SSD और pen drives आते हैं।
Data processing
कच्चे data में अक्सर ख़ाली जगहें, spelling errors या ग़लत entries होती हैं। Calculation से पहले cleaning उन्हें हटाती या ठीक करती है।
# Processing raw data: clean, then summarise
raw = ['45', ' 67', 'abs', '89 ', '', '72']
clean = []
for v in raw:
v = v.strip()
if v.isdigit():
clean.append(int(v))
print('Valid:', clean, '| ignored:', len(raw) - len(clean))
print('Average:', round(sum(clean) / len(clean), 2))Statistical techniques
Python में statistics
marks = [56, 72, 91, 72, 64, 85, 72, 48, 90, 60]
n = len(marks)
mean = sum(marks) / n
s = sorted(marks)
if n % 2 == 0:
median = (s[n // 2 - 1] + s[n // 2]) / 2
else:
median = s[n // 2]
mode = max(set(marks), key=marks.count)
print('Sorted:', s)
print('Mean :', mean)
print('Median:', median)
print('Mode :', mode)
print('Range :', max(marks) - min(marks))import statistics as st
marks = [56, 72, 91, 72, 64, 85, 72, 48, 90, 60]
print('mean :', st.mean(marks))
print('median :', st.median(marks))
print('mode :', st.mode(marks))
print('pstdev :', round(st.pstdev(marks), 2)) # population SD
print('pvar :', round(st.pvariance(marks), 2))Standard deviation
SD = √( Σ(x − mean)² ÷ n )। Steps: mean निकालें, हर value से घटाएँ, square करें, squares का average (variance) लें, square root लें।
# Standard deviation by formula, step by step
data = [4, 8, 6, 2]
m = sum(data) / len(data)
sq = [(x - m) ** 2 for x in data]
var = sum(sq) / len(data)
print('mean =', m)
print('squared deviations =', sq)
print('variance =', var, '| SD =', round(var ** 0.5, 3))सारांश
- Data → processing → information।
- Structured data tables में आता है; unstructured नहीं।
- Mean, median, mode, range और SD data set को summarise करते हैं; Python का
statisticsmodule इन्हें निकालता है।
