★★★★★
"The one step solution for my son. Modern Age Coders make learning coding so simple that kids love it. The teachers explain complex concepts clearly with practical exercises and interactive content."
Ria Mukherjee
Parent
CBSE Class 12 · Informatics Practices, code 065 · Unit 1, pandas
A Series is a small thing: one column of values with a name tag on each. Nearly every mark lost on it comes from reading the wrong tag. These pandas Series class 12 notes cover what the 065 syllabus lists, and they stop at each place where a label and a position look alike. Every output on the page was printed by pandas 2.3.
Live one to one · 15 output questions · labels, positions and NaN explained · your own days and hours
Start here
The first course is the board subject itself. The second goes on with pandas after school topics end, and the third strengthens the SQL half of the same paper.

065 / The whole subject
Series opens the Class 12 year here, DataFrame and Matplotlib follow, then SQL functions, networks and societal impacts.
Open the course →
After the board topics
NumPy and pandas on real data: filtering, grouping, missing values and honest charts, ending in a data story.
Open the course →
The other 25 marks
For a student at ease in pandas who still mixes up WHERE and HAVING. Starts from the first table.
Open the course →Ans. The short version
A pandas Series in Class 12 IP (CBSE 065) is a one-dimensional labelled array: each value has an index label, given by you or numbered from 0. The 2026-27 syllabus asks you to create a Series from an ndarray, a dictionary or a scalar, do mathematical operations on it, use head() and tail(), and select, index and slice its elements. A slice by label includes the last label; a slice by position does not. Modern Age Coders teaches this live, personalised one to one, and a priority demo lets you try a full class first.
Topic 1. Values with labels
A Series is a one-dimensional array of values in which every value has a label. The set of labels is called the index. You create one with pd.Series(data, index), and the 065 syllabus names three kinds of data: an ndarray, a dictionary and a scalar value.
import numpy as np import pandas as pd arrows = np.array([9, 10, 7, 8]) plain = pd.Series(arrows) # labels made for you rounds = pd.Series(arrows, index=["R1", "R2", "R3", "R4"]) print(plain) print(rounds)
0 9 1 10 2 7 3 8 dtype: int64 R1 9 R2 10 R3 7 R4 8 dtype: int64
Left column: index. Right column: values. The last line is the data type of the values.
import pandas as pd
rate = {"Haldi": 28, "Jeera": 62, "Saunf": 45}
spice = pd.Series(rate) # keys become labels
chosen = pd.Series(rate, index=["Saunf", "Haldi", "Hing"])
print(spice)
print(chosen)Haldi 28 Jeera 62 Saunf 45 dtype: int64 Saunf 45.0 Haldi 28.0 Hing NaN dtype: float64
Hing is not a key, so its value is missing: NaN, "not a number". One NaN is enough to turn the whole Series into float64.
import pandas as pd
locker = pd.Series("free", index=[11, 12, 13])
locker[12] = "taken"
print(locker)11 free 12 taken 13 free dtype: object
The value is repeated once for each label. Strings give dtype object.
| Call | Result | Remember |
|---|---|---|
pd.Series([2.5, 4]) | Labels 0 and 1, values 2.5 and 4.0 | A list works like an ndarray; one decimal makes all of them float64 |
pd.Series(5) | Label 0, value 5 | Without an index a scalar gives a single row |
pd.Series(np.array([9, 10, 7]), index=["R1", "R2"]) | ValueError | An array needs exactly as many labels as values |
pd.Series({"a": 1}, index=["a", "b"]) | a 1.0, b NaN | A dictionary may have fewer or more labels than keys |
pd.Series({9, 10}) | TypeError | A set has no order, so pandas refuses it |
A label may be repeated, and it does not have to be a number. The values are in s.values, the labels in s.index, and how many there are in s.size.
| Point | List | ndarray | Series |
|---|---|---|---|
| Labels of your own | No | No | Yes |
| Found by | position | position | label or position |
| Times 2 | list is repeated | each value doubled | each value doubled |
| Plus 10 | TypeError | added to each | added to each |
| Adding two of unequal length | joined end to end | ValueError | matched by label, NaN where one is missing |
Topic 2. Reaching a value
Use a label to reach a value by name and a position to reach it by place. In a slice, the label form includes the end and the position form leaves it out. That one sentence answers Question 1 of the 2026-27 sample paper.
import pandas as pd
laps = pd.Series([24, 18, 30, 15, 21, 27],
index=["Asma", "Bina", "Chet",
"Dolly", "Eknath", "Firoz"])
print(laps["Chet"]) # one label, one value
print(laps[["Firoz", "Asma"]]) # list of labels
print(laps["Bina":"Dolly"]) # label slice
print(laps[1:3]) # position slice
print(laps[laps > 23]) # condition30 Firoz 27 Asma 24 dtype: int64 Bina 18 Chet 30 Dolly 15 dtype: int64 Bina 18 Chet 30 dtype: int64 Asma 24 Chet 30 Firoz 27 dtype: int64
One label gives a plain value. Every other line gives a smaller Series, still carrying its labels.
The same six swimmers, with more expressions. The last column is what pandas returned.
| Expression | Reads as | Values |
|---|---|---|
laps.loc["Bina":"Dolly"] | labels, both ends in | 18, 30, 15 |
laps.iloc[1:3] | positions 1 and 2 | 18, 30 |
laps[-2:] | last two positions | 21, 27 |
laps[::2] | every second value | 24, 30, 21 |
laps[::-1] | backwards | 27, 21, 15, 30, 18, 24 |
laps[(laps > 20) & (laps < 28)] | two conditions, each in brackets | 24, 21, 27 |
laps["Zubin"] | a label that is not there | KeyError |
laps.iloc[9] | a position that is not there | IndexError |
head(n) returns the first n elements and tail(n) the last n. If n is left out, it is 5.
| On laps | Elements returned | Why |
|---|---|---|
laps.head() | Asma to Eknath, five | Default n is 5 |
laps.head(2) | Asma, Bina | First two |
laps.tail(2) | Eknath, Firoz | Last two, not reversed |
laps.head(-2) | Asma to Dolly, four | All but the last two |
laps.tail(-4) | Eknath, Firoz | All but the first four |
laps.head(20) | all six | Asking for too many is not an error |
import pandas as pd
laps = pd.Series([24, 18, 30, 15],
index=["Asma", "Bina", "Chet", "Dolly"])
laps["Bina"] = 20 # label exists: change
laps["Gita"] = 12 # label is new: add
laps["Chet":"Dolly"] = 0 # change a slice
print(laps)Asma 24 Bina 20 Chet 0 Dolly 0 Gita 12 dtype: int64
Reading an unknown label is a KeyError. Assigning to one adds it.
import pandas as pd roll = pd.Series([88, 74, 91, 60], index=[2, 4, 6, 8]) print(roll[2]) # label 2 print(roll[0:2]) # positions 0 and 1 print(roll.loc[2:6]) # labels 2 to 6 print(roll.iloc[0]) # position 0
88 2 88 4 74 dtype: int64 2 88 4 74 6 91 dtype: int64 88
A single number in the bracket is a label here, but a slice of numbers counts positions. loc always means labels and iloc always means positions, so use them when labels are numbers.
Text labels and s[0]. With labels a, b, c, s[0] still gives the first value on pandas 2.3, along with a FutureWarning. On pandas 3 it is a KeyError. Write s.iloc[0] or the label and your answer is right on both.
Topic 3. Arithmetic
An operation between two Series matches values by label. If a label is present in only one of them, the result for that label is NaN. An operation with a single number is applied to every value.
import pandas as pd jan = pd.Series([150, 90, 200], index=["Ila", "Jay", "Kavi"]) feb = pd.Series([60, 110, 75], index=["Jay", "Kavi", "Lata"]) print(jan + feb) print(jan.sub(feb, fill_value=0))
Ila NaN Jay 150.0 Kavi 310.0 Lata NaN dtype: float64 Ila 150.0 Jay 30.0 Kavi 90.0 Lata -75.0 dtype: float64
sub() with fill_value=0 treats a missing partner as 0, so Lata is 0 - 75.
| Step: every label once | jan | feb | jan + feb |
|---|---|---|---|
| Ila | 150 | missing | NaN, no partner |
| Jay | 90 | 60 | 150.0 |
| Kavi | 200 | 110 | 310.0 |
| Lata | missing | 75 | NaN, no partner |
List all the labels, fill the two middle columns, and only then add. Write 150.0, not 150, because a Series holding NaN is float64. The labels come out in sorted order when the two indexes are not the same.
import pandas as pd cm = pd.Series([152, 167, 140], index=["Om", "Pia", "Raj"]) print(cm / 100) # every value, a float result print(cm // 30) # whole number division print(cm >= 150) # True or False for each label
Om 1.52 Pia 1.67 Raj 1.40 dtype: float64 Om 5 Pia 5 Raj 4 dtype: int64 Om True Pia True Raj False dtype: bool
A comparison gives True or False for each label. Put it inside the bracket and it becomes a filter: cm[cm >= 150].
+, -, *, / have partners add(), sub(), mul(), div(). Use the method when you need fill_value.
No error. 6 divided by 0 is inf, and 0 divided by 0 is NaN.
A list has no labels, so it is added by position. If the lengths differ you get a ValueError, not NaN.
Topic 4. Cover the answers
For each one, write the output on paper with labels, values and dtype, then open the answer. Assume pandas is imported as pd and numpy as np.
s = pd.Series([6, 8, 10]) print(s * 2)
0 12 1 16 2 20 dtype: int64
s = pd.Series(["om", "dev"], index=[1, 2]) print(s * 2)
1 omom 2 devdev dtype: object
s = pd.Series({"p": 4, "q": 9}, index=["q", "r"])
print(s)q 9.0 r NaN dtype: float64
s = pd.Series([11, 22, 33, 44, 55, 66]) print(list(s.head()), list(s.tail(2)))
[11, 22, 33, 44, 55] [55, 66]
s = pd.Series([11, 22, 33, 44], index=list("wxyz"))
print(list(s["x":"z"]), list(s[1:3]))[22, 33, 44] [22, 33]
a = pd.Series([1, 2], index=["m", "n"]) b = pd.Series([5, 6], index=["n", "m"]) print(a + b)
m 7 n 7 dtype: int64
s = pd.Series([5, 15, 25]) print(s > 10)
0 False 1 True 2 True dtype: bool
s = pd.Series([40, 50, 60, 70]) print(list(s[::-1]), list(s[-2:]))
[70, 60, 50, 40] [60, 70]
s = pd.Series([2, 3, 4], index=["a", "b", "c"]) s["b"] = 30 s["d"] = 5 print(s.size, s["b"] + s["d"])
4 35
s = pd.Series([7, None, 9]) print(s)
0 7.0 1 NaN 2 9.0 dtype: float64
x = [3, 4] y = pd.Series(x) print(x * 2) print(list(y * 2))
[3, 4, 3, 4] [6, 8]
s = pd.Series(np.arange(10, 50, 10), index=[5, 6, 7, 8]) print(s[6], list(s[1:3]))
20 [20, 30]
s = pd.Series([12, 7, 20, 3], index=list("abcd"))
print(list(s[s % 2 == 0].index))['a', 'c']
s = pd.Series([9, 4, 6]) print((s ** 2)[1:])
1 16 2 36 dtype: int64
s = pd.Series([10, 20, 30, 40]) s[1:3] = 0 print(list(s), s.head(-1).size)
[10, 0, 0, 40] 3
Should the dtype line be written? The official scheme for Question 30 (A) (ii) shows the three labels and values and no dtype line. Writing it does no harm if it is right, and it trains you to notice when int has become float.
Topic 5. Blank page
A Series program is short: import pandas, create the Series, do one operation, print. The marks sit in the detail, so each of these four carries one detail that is easy to miss.
import pandas as pd
def bill_after_offer(price, limit):
"""Return a Series with 10% off above the limit."""
price[price > limit] = price * 0.9
return price
spice = pd.Series({"Haldi": 28.0, "Jeera": 62.0,
"Saunf": 45.0, "Elaichi": 310.0})
print(bill_after_offer(spice, 50))Haldi 28.0 Jeera 55.8 Saunf 45.0 Elaichi 279.0 dtype: float64
The condition chooses the labels to change, and alignment picks the matching new values. The prices are typed as decimals, since 55.8 does not fit in an int64 Series.
import pandas as pd
stock = pd.Series({"Bat": 14, "Ball": 60, "Net": 5})
sold = pd.Series({"Ball": 48, "Bat": 6})
left = stock.sub(sold, fill_value=0) # Net was not sold
print(left)
print("Order again:", list(left[left < 10].index))Ball 12.0 Bat 8.0 Net 5.0 dtype: float64 Order again: ['Bat', 'Net']
With a plain minus sign Net would be NaN, and NaN < 10 is False, so the item would vanish from the list.
import pandas as pd
meter = pd.Series([1204, 1260, 1331, 1420],
index=["Apr", "May", "Jun", "Jul"])
print(meter[1:] - meter[:-1])Apr NaN Jul NaN Jun 0.0 May 0.0 dtype: float64
May is matched with May and June with June, so they cancel.
import pandas as pd
meter = pd.Series([1204, 1260, 1331, 1420],
index=["Apr", "May", "Jun", "Jul"])
later = meter[1:] # May, Jun, Jul
earlier = meter[:-1].values # array, no labels
print(later - earlier) # by position nowMay 56 Jun 71 Jul 89 dtype: int64
.values is an ndarray without labels, so subtraction goes by position.
import pandas as pd
theory = pd.Series([48, 61, 22], index=["Zoya", "Udit", "Tara"])
practical = pd.Series([27, 24, 29],
index=["Udit", "Tara", "Zoya"])
total = theory + practical
print(total)
print("Above 60:")
print(total[total > 60])Tara 46 Udit 88 Zoya 77 dtype: int64 Above 60: Udit 88 Zoya 77 dtype: int64
Zoya is 48 + 29 although she is first in one Series and last in the other.
import Pandas as pd kg = pd.series([3, 5, 7], index=["x", "y"]) kg["w"] = 9 print(kg.head[2]) print(kg["x":"y"] * 2)
pandas in small letters; pd.Series with a capital S; a third label, such as "z", for the third value; kg.head(2) with round brackets. The other two lines are correct. The last one then prints x 6 and y 10.In the 2026-27 scheme, Question 30 (A) gives 2 marks for creating a Series from a dictionary and 1 mark for the output of adding two Series. The question asks for a particular name for the Series, so use the name given.
print(Fare.tail(3)) or print(Fare[-3:])s["b"] = 30. Assigning to a new label adds an element, so the size can grow as well.s["b":"d"] and s[1:3] give the same result when the labels are a to e. Reason: A slice by label includes its last label. pd.Series(0, index=[101, 102, 103, 104])print(Temp[Temp < 15])Elements above the 75th percentile, which the suggested practical list asks for, are solved in the IP practical file.
In class the student draws each Series as two columns before touching the keyboard. Alignment questions then answer themselves.
Every bracket is read aloud with one of these two words. It is the quickest cure for slicing mistakes.
An output is written first. If pandas disagrees, the student says why before we move on.
A DataFrame is a set of Series side by side, so the next page is DataFrame for Class 12 IP, and Matplotlib charts come after it. To test yourself use the IP MCQ test and the important questions; to speak the answers, the IP viva questions.
One to one, at your own timing
Series is a chapter where a wrong answer looks exactly like a right one until somebody asks which label it came from. In a personalised one to one class somebody does ask. The days and the hour are yours to set. Begin with the priority demo, a paid full class whose fee comes off the first month if you enrol, or with a free demo class. Fees are monthly, admission costs nothing extra, and any month end can be your last.
Before you enrol · Try a class
a full live class of about 45 to 60 minutes
The classes · Choose your own timing
₹4,999
per month, 4 private classes, fully flexible timingtwo private classes a week, at a time set with you
If your school has already finished pandas, one class on mixed outputs shows whether Series needs a full return or only a tidy-up. The monthly fee appears on this page in the currency you use.
Studying outside India?
A student in Muscat or Singapore prepares the same Unit 1 for 065. Fix the hour after your own school day and it stays yours.
| Where you live | Time difference | Usual class window, local time | Format |
|---|---|---|---|
| India every Indian city | Indian time | Any time you choose | Personalised 1-on-1 |
| UAE and Oman Dubai, Abu Dhabi, Sharjah, Muscat | 1 h 30 min behind India | 3:00 PM to 9:00 PM | Personalised 1-on-1 |
| Saudi Arabia, Qatar, Kuwait, Bahrain Riyadh, Jeddah, Dammam, Doha, Kuwait City, Manama | 2 h 30 min behind India | 3:00 PM to 9:00 PM | Personalised 1-on-1 |
| Nepal Kathmandu | 15 min ahead of India | 4:30 PM to 9:00 PM | Personalised 1-on-1 |
| Ethiopia and East Africa Addis Ababa and East Africa Time | 2 h 30 min behind India | 4:30 PM to 9:00 PM | Personalised 1-on-1 |
| Singapore and Malaysia Singapore, Kuala Lumpur | 2 h 30 min ahead of India | 3:30 PM to 9:00 PM | Personalised 1-on-1 |
Any laptop that runs Python will do. If pandas will not install on it, tell us when you book and we begin there.
What families say
Real reviews from real families. We neither write nor commission them.
★★★★★
"The one step solution for my son. Modern Age Coders make learning coding so simple that kids love it. The teachers explain complex concepts clearly with practical exercises and interactive content."
Ria Mukherjee
Parent
★★★★★
"Modern Age Coders has been a game-changer for me. I struggled to grasp IT concepts and coding before joining, but their classes transformed everything. I can now confidently write complex programs with ease."
Samriddha Mondal
Student
★★★★★
"One of the most wonderful education centres out there. Education is not limited to school syllabus but focuses on skill development."
Vansh Agarwal
Student
★★★★★
"My child Dhairya is really enjoying the Modern Age Coders classes. This is his first online class and he eagerly looks forward to it. I can already see his improvement, and the teachers are very cooperative."
Sonam Oswal
Parent of Dhairya
★★★★★
"Modern Age Coders have wonderful teachers who teach in a clear, easy and practical way. The teacher boosts students' confidence and inspires them to learn without hesitation."
Sonu Goyal
Parent
★★★★★
"I highly recommend this computer coding class! The teachers are incredibly knowledgeable and passionate about coding."
Ritu Kedia
Parent
The rest of the Class 12 series
Every page in the CBSE Class 12 Informatics Practices series, grouped by what you need.
CBSE Class 12 Computer Science (083): Class 12 CS viva questions Class 12 CS sample paper practice Class 12 CS project with source code Class 12 CS important questions
CBSE Class 12 Information Technology (802): IT 802 practical and project file IT 802 Java notes and programs IT 802 notes
CBSE Class 11 CS, IP and AI: Class 11 CS practical file Class 11 IP practical file CS or IP in Class 11
ISC Computer Science (868): ISC Class 12 CS syllabus 2027 ISC Class 12 CS practice paper ISC Class 12 practical questions solved ISC Boolean algebra and K-maps
Program lists with output: Class 12 practical file programs Python programs for Class 11 CS and IP
Questions about Series
A Series is a one-dimensional labelled array in the pandas library. It holds values of one data type, such as whole numbers, decimals or strings, and gives each value a label called its index. It is the first of the two pandas data structures in the CBSE 065 syllabus. The other is the DataFrame, which has rows and columns.
Import pandas and call pd.Series(data, index). The data can be an ndarray, a dictionary or a scalar value, which are the three named in the 2026-27 syllabus, or a list. If you give no index, labels start from 0. For a dictionary the keys become the labels, and for a scalar the value repeats for every label.
A Series is one-dimensional: one column of values with one index. A DataFrame is two-dimensional: rows and columns, with labels for both. Each column of a DataFrame is a Series, which is why selecting a single column prints an index, the values, a name and a dtype.
Label indexing uses the index value you see printed on the left, for example s["Chet"]. Positional indexing counts places from 0, for example s.iloc[2]. A label slice includes both ends, while a positional slice leaves the stop position out. With whole number labels, s[2] means the label 2, so use loc and iloc to be safe.
pandas adds values that have the same label. When a label exists in only one Series there is nothing to add, so the result is NaN. To treat the missing value as zero, use s1.add(s2, fill_value=0). Whole numbers also turn into decimals in the result, because NaN can only be stored in a float Series.
head(n) returns the first n elements as a Series and tail(n) the last n. Without a number both use 5. If the Series is shorter than n you simply get all of it. A negative number means all but that many, so head(-1) leaves out the last element.
CBSE gives 25 marks to the unit on pandas and data visualization together and no separate mark for Series. In the 2026-27 sample paper, Questions 1, 8 and 12 are on Series for one mark each, and Question 30 offers a three-mark Series part as a choice against a DataFrame part.
Its values are. s["b"] = 30 replaces a value, and s["b":"c"] = 0 replaces a slice. You can also add an element by assigning to a label that does not exist yet. Some school notes call a Series size-immutable. pandas itself does let a new label add an element, as the laps program on this page shows.
On pandas 2, which most school labs still use, it prints as object. pandas 3 prints str for the same data. Whole numbers show int64, decimals float64, and True or False shows bool. If a numeric Series has a missing value, expect float64.
The 065 document lists selection, indexing and slicing for Series without naming loc or iloc. They are worth knowing, because they state clearly whether you mean a label or a position. The plain bracket also works, and official answers for Series use it.
Yes. Modern Age Coders teaches pandas live and one to one, at a day and hour you choose, with the student writing and running the code. You may try a priority demo of about 45 to 60 minutes, followed by a written skill report, and its fee is adjusted in the first month if you enrol. A free demo class is also offered.
Start
In the free demo class, show us a question you got wrong. We draw its index, run it, and change one label to see what moves.
The priority demo goes the full length, at a slot that you pick: creation, slicing and addition from a blank file, five timed outputs, and a skill report sent to you in writing. If you join, its fee is taken off the first month.
Need the marks of the whole subject first? See the IP syllabus and paper pattern.
WhatsApp us · +91 91233 66161 · connect@modernagecoders.com
Every class is live video. The form requests a callback and reserves nothing.
A full live class of about 45 to 60 minutes at a slot you pick, with a written skill report and learning roadmap on WhatsApp afterwards. The fee is adjusted against your first month if you enrol.
Book a priority demo