Getting Started with Pandas Series
Today I explored Pandas, one of the most powerful Python libraries for data analysis. I began with the Series object, which is like a 1D labeled array.
πΉ Creating a Series
import pandas as pd
data = [10, 20, 30, 40]
s = pd.Series(data)
print(s)
β Output:
0 10
1 20
2 30
3 40
dtype: int64
πΉ Custom Index
s = pd.Series([10, 20, 30], index=["a", "b", "c"])
print(s["b"]) # 20
πΉ From Dictionary
data = {"apples": 3, "bananas": 5, "oranges": 2}
fruits = pd.Series(data)
print(fruits)
πΉ Vectorized Operations
print(s * 2)
a 20
b 40
c 60
β‘ Interesting Facts
β’ A Pandas Series is built on NumPy arrays (fast + efficient).
β’ Labels (index) make data handling more intuitive.
β’ Itβs the foundation for Pandas DataFrame.
β¨ Reflection
Series may look simple, but theyβre the first step toward mastering data manipulation in Pandas. I can already see how useful theyβll be for analytics tasks.
Next β Iβll dive into Pandas DataFrames π
Top comments (0)