Series के Methods (head/tail/describe)
Quick methods आपको एक Series की शुरुआत, अंत, और summary देखने देते हैं।
In this page:
Syntax
s.head(n)
s.tail(n)
s.describe()
Series Methods (head/tail/describe)
head(n) पहले n items दिखाता है और tail(n) last n; दोनों default से 5 हैं। describe() numbers के लिए count, mean, std, min, quartiles, और max summarize करता है। value_counts() हर distinct value tally करता है।
Note:
text data पर describe() count, unique, top, और freq report करता है।
उदाहरण: Series methods (head/tail/describe)
import pandas as pd
s = pd.Series([4, 8, 15, 16, 23, 42])
print(s.head(2))
print(s.tail(2))
print(s.describe())
# Output:
# 0 4
# 1 8
# dtype: int64
# 4 23
# 5 42
# dtype: int64
# count 6.000000
# mean 18.000000
# std 13.490738
# min 4.000000
# 25% 9.750000
# 50% 15.500000
# 75% 21.250000
# max 42.000000
# dtype: float64
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. #}
आम गलतियां
- यह भूल जाना कि head default से 5 है
- बहुत mixed data पर describe इस्तेमाल करना
- value_counts को unique से confuse करना
चैप्टर सारांश
- head और tail ends पर झलक देते हैं
- describe summarize करता है
- value_counts values tally करता है
- Defaults 5 rows हैं
🔒
Chapter Quiz — Complete all 7 topics to unlock
0/7 topics done
Complete these topics first: