🔵 Data Science  ·  Lesson 42

Data Science के लिए Statistics

Statistics Basics क्या है?

Statistics Basics ka matlab hai: Statistics helps summarize and understand data using mean, median, mode, range and standard deviation. Simple words me, ye topic practical Python programs likhne me direct use hota hai.

Is topic ko sirf definition ke liye nahi, balki summarising marks jaise real examples ke liye practice karein.

यह क्यों सीखना जरूरी है?

  • Ye summarising marks me kaam aata hai.
  • Ye understanding average and spread se bhi connected hai.
  • Isse aap code ka output aur errors better samajh paate hain.

Important Terms

TermMeaning
meanAverage value.
medianMiddle value after sorting.
modeMost frequent value.
varianceSpread of data values.
standard deviationMeasure of spread around the mean.

Syntax / Basic Pattern

Basic idea: pehle data तैयार करें, phir Python logic apply करें, aur finally result display करें.

Basic Pattern
import statistics as stats
marks = [80, 85, 85, 90, 100]
print("Mean:", stats.mean(marks))
print("Median:", stats.median(marks))
print("Mode:", stats.mode(marks))

Complete Example Program

Python – statistics-basics.py
import statistics as stats

marks = [80, 85, 85, 90, 100]
print("Mean:", stats.mean(marks))
print("Median:", stats.median(marks))
print("Mode:", stats.mode(marks))

Expected Output

Mean: 88 Median: 85 Mode: 85

Program Explanation

  • import statistics as stats imports ready-made features from a module/library.
  • marks = [80, 85, 85, 90, 100] stores a value in marks.
  • print("Mean:", stats.mean(marks)) displays information or calculated result on the screen.
  • print("Median:", stats.median(marks)) displays information or calculated result on the screen.
  • print("Mode:", stats.mode(marks)) displays information or calculated result on the screen.

Practical Uses

  • Summarising marks.
  • Understanding average and spread.
  • Supporting ml decisions.

Common Mistakes

  • Analysing data before checking missing values, duplicates and data types.
  • Changing original data without keeping a clean copy.
  • Creating charts without title, labels or explanation.

Practice Tasks

  1. Program ko statistics-basics.py file me type karke run karein.
  2. Values change karke output compare karein.
  3. summarising marks par ek छोटा example banayen.
  4. Logic ko apne words me 5 lines me likhein.

सारांश

Statistics Basics ko tab complete maanenge jab aap iska meaning, example, output aur practical use clearly explain kar saken.

← Back to Python Tutorial
🔗

Share this topic with a friend

यह topic किसी दोस्त को भेजें

Found it useful? Send it to a classmate learning the same thing.

अच्छा लगा? जो दोस्त यही सीख रहा है, उसे भेज दीजिए।

💻 लाइव कोड एडिटर

इस पेज के प्रोग्राम यहीं तैयार हैं — चलाएँ, बदलें और सीखें। कुछ भी इंस्टॉल किए बिना।
OneCompiler द्वारा संचालित। कोड एडिटर में अपने आप आ जाता है — Run दबाकर आउटपुट देखें। अगर एडिटर न खुले तो नए टैब में खोलें.