← Back to Pandas Course | Chapter 1: Getting Started | Lesson 4 of 7

Series की बुनियादी बातें

एक Series data का एक single labelled column है: values plus एक index जो हर एक को नाम देता है।

In this page:

  1. Series Basics
Syntax
python
s = pd.Series([value1, value2, value3], index=[label1, label2, label3])

Series Basics

एक Series एक index वाला एक one-dimensional array है। अगर आप एक index supply नहीं करते यह 0, 1, 2 वगैरह इस्तेमाल करता है। यह एक dtype hold करता है और fast vectorized maths support करता है।

Note: एक DataFrame column खुद एक Series है।

उदाहरण: Series basics

python
import pandas as pd

s = pd.Series([90, 85, 70], index=["math", "art", "music"])
print(s)
print("art:", s["art"])
print(s * 2)

# Output:
# math     90
# art      85
# music    70
# dtype: int64
# art: 85
# math     180
# art      170
# music    140
# dtype: int64
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. यह भूल जाना कि index labels exist करती हैं
  2. यह मान लेना कि एक Series बिल्कुल एक list जैसा behave करता है
  3. types mix करना और object dtype पाना
चैप्टर सारांश
  • एक Series values plus एक index है
  • Default index 0..n-1 है
  • यह एक dtype hold करता है
  • Maths vectorized है
🔒

Chapter Quiz — Complete all 7 topics to unlock

0/7 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.