← Back to NumPy Course | Chapter 8: Statistics | Lesson 2 of 6

np.percentile/quantile का इस्तेमाल

Percentiles बताते हैं कि किस value से नीचे data का एक दिया गया share गिरता है।

In this page:

  1. np.percentile/quantile
Syntax
python
np.percentile(arr, q)
np.quantile(arr, fraction)

np.percentile/quantile

np.percentile(a, 90) वह value ढूंढता है जिसमें 90 percent data इस पर या इससे नीचे है। np.quantile 0 से 1 तक fractions इस्तेमाल करते हुए same करता है। 50th percentile median है, और 75th और 25th के बीच का gap interquartile range है।

Note: एक साथ कई पाने के लिए [25, 50, 75] जैसी एक list pass करें।

उदाहरण: np.percentile/quantile

python
import numpy as np

scores = np.array([55, 60, 65, 70, 75, 80, 85, 90, 95, 100])
print(np.percentile(scores, 50))
print(np.percentile(scores, [25, 75]))
print(np.quantile(scores, 0.9))

# Output:
# 77.5
# [66.25 88.75]
# 95.5
Related Topics
{# common_mistakes/chapter_summary/browser_support: on Hindi pages the view already swaps in the hi_ translation fields (or blanks these out if untranslated), so this renders correctly for both languages without a lang_code check here. #}
आम गलतियां
  1. percent (0-100) को quantile fractions (0-1) से mix करना
  2. values के बीच interpolation भूल जाना
  3. percentile को percentage से confuse करना
चैप्टर सारांश
  • percentile 0 से 100 इस्तेमाल करता है
  • quantile 0 से 1 इस्तेमाल करता है
  • 50th percentile median है
  • IQR = Q3 minus Q1 होता है
🔒

Chapter Quiz — Complete all 6 topics to unlock

0/6 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.