On this page
NumPy is the first library most Class 11 Informatics Practices students meet, and it is where many lose easy marks: a missing pair of square brackets, an array that quietly turned into text, a slice that stops one element early. This post covers what the current syllabus asks for, how to create arrays from lists, and how indexing and slicing work, with code we ran and checked.
What does the 2026-27 CBSE syllabus ask about NumPy?
The CBSE Informatics Practices curriculum for Class XI (2026-27) puts NumPy inside Unit 2, Introduction to Python, which carries 25 of the 70 theory marks. The NumPy line is short: "Introduction to NumPy: Introduction, Creation of NumPy Arrays from List". The practical exam is worth 30 marks.
The textbook goes further. Chapter 6 of the NCERT Informatics Practices Class XI book, "Introduction to NumPy" (reprint 2026-27), covers array attributes, indexing, slicing, operations, reshaping and statistics. Ask your teacher which sections your school will test. Indexing and slicing are worth learning either way, because the same curriculum's Class XII Unit 1 starts with creating a Pandas Series "from ndarray" and with "Selection, Indexing and Slicing".
How do you create a NumPy array from a list?
Import the library, then pass one list to `np.array()`:
import numpy as np
marks = np.array([62, 75, 58, 80])
scores = np.array([[62, 75, 58, 80],
[71, 68, 90, 77],
[55, 82, 64, 70]])A list of lists gives a 2-D array. NCERT lists the attributes you should know:
`ndim` is the number of dimensions: `scores.ndim` gives 2.
`shape` gives the size along each dimension: `scores.shape` gives (3, 4), meaning 3 rows and 4 columns.
`size` is the total number of elements, the product of the shape: 3 × 4 = 12.
`dtype` is the type shared by every element. NCERT's printed output shows int32; when we ran this code it showed int64. Both are integers; the default size depends on your system and NumPy version.
Other ways to create arrays from the same chapter: `np.zeros((2, 3))` gives a 2 × 3 array of 0.0, `np.ones((3, 2))` gives 1.0s, and `np.arange(2, 20, 3)` works like `range()` and gives `array([ 2, 5, 8, 11, 14, 17])`.
Worked example: indexing and slicing a marks table
Treat `scores` above as sample marks for three students (rows) in four tests (columns). These are made-up numbers for practice.
One element. `scores[1, 2]` means row index 1, column index 2. Counting from zero, that is the second student's third test: 90.
One row. `scores[0]` gives the first student's marks: `[62 75 58 80]`.
One column. `scores[:, 3]` means every row, column index 3: `[80 77 70]`, everyone's fourth test.
A block. `scores[0:2, 1:3]` takes rows 0 and 1 and columns 1 and 2. The end index is excluded, so the result is `[[75 58] [68 90]]`.
Reverse a row. `scores[2, ::-1]` gives `[70 64 82 55]`. A step of -1 walks backwards, as in NCERT's `array8[::-1]` example.
Last element. `scores[-1, -1]` counts from the end and gives 70.
Every whole-array operation works element by element. `scores[:, 1] + 5` adds 5 to each mark in the second test and gives `[80 73 87]`. A Python list cannot do that directly.
What mistakes cost marks with NumPy arrays?
Forgetting the square brackets. `np.array(1, 2, 3)` raises a TypeError. NCERT flags this one: pass a single list, `np.array([1, 2, 3])`.
Mixed types. `np.array([5, -7.4, 'a', 7.2])` gives `array(['5', '-7.4', 'a', '7.2'], dtype='<U32')`. Every number became a string, so arithmetic will fail.
Including the end index. `[3:5]` gives indices 3 and 4, not 5. Write the indices you expect before running the code.
Reading shape the wrong way round. (3, 4) is rows first, then columns.
Going out of bounds. `scores[3, 0]` raises "index 3 is out of bounds for axis 0 with size 3", because the rows are numbered 0, 1 and 2.
Assuming a slice is a copy. The NumPy indexing guide says "all arrays generated by basic slicing are always views of the original array", unlike slices of a Python list. If you write `row = scores[0]` and then `row[0] = 100`, the original `scores` changes too. Use `scores[0].copy()` when you want a separate copy.
Why do arrays matter beyond the exam?
NCERT's comparison table gives the practical reasons: arrays hold one data type, are stored contiguously in memory and support element-wise operations, which makes them faster and smaller than lists for numbers. NumPy is also the base layer for most scientific work in Python. Harris and colleagues, writing in Nature, describe it as "the foundation upon which the scientific Python ecosystem is constructed", used in fields from physics to finance. When you reach Class XII, our guide to Pandas Series and DataFrames picks up where this leaves off.
A one-week practice routine
Day 1: Type the NCERT chapter's creation examples yourself. For each, write the shape and dtype on paper before you run it.
Day 2: Make a 4 × 5 array of your own sample data. Write ten indexing questions ("third column", "last two rows") and answer them on paper, then check in Python.
Day 3: Slicing only: five 1-D slices and five 2-D slices, including one with a negative step.
Day 4: Break things on purpose: missing brackets, a mixed list, an out-of-range index. Copy each error message into your notes with its fix.
Day 5: Write two short programs for your practical file, such as average marks per test using a column slice.
If a word like "axis" or "dtype" still feels vague, the Fermi Concept Library covers every concept in physics, chemistry, biology, mathematics and computing, each with its own lesson.
Open Python tonight, build the `scores` array above, and predict the output of `scores[1:, ::2]` before you run it.



