Informatics PracticesClass 11Introduction Chapter to NumPy

Introduction Chapter to NumPy | Class 11 Informatics Practices Notes

By ConceptScroll Team · Published on 17 July 2026 · 3 min read

Introduction Chapter to NumPy – this guide gives you a concise, exam-ready overview of Introduction Chapter to NumPy from Class 11 Informatics Practices, written by ConceptScroll editors and reviewed against the latest NCERT textbook.

6.4 INDEXING AND SLICING

Indexing and slicing are fundamental techniques to access and extract parts of NumPy arrays. Indexing refers to accessing individual elements using their position indices, which start at 0. For 1-D arrays, a single index suffices, while for 2-D arrays, two indices (row and column) are used. For example, in a 2-D array marks[4][3], marks[i, j] accesses the element at (i+1)th row and (j+1)th column. Attempting to access an index outside the array bounds results in an IndexError. Slicing allows extracting subarrays by specifying a range of indices using the syntax [start:end], where the start index is inclusive and the end index is exclusive. Negative step values can reverse arrays. For 2-D arrays, slicing can be applied along rows and columns simultaneously using [row_start:row_end, col_start:col_end]. Omitting indices implies selecting all elements along that axis. These operations enable efficient data retrieval and manipulation within arrays.

📊 Diagram: Table showing marks of students in different subjects to illustrate 2-D array indexing.

🧪 Activity: Think and Reflect: When might we require to create an array initialized to zeros or ones?

🔗 Connection: Prepares for understanding arithmetic and other operations on arrays.

Frequently asked questions

1. What is NumPy? How to install it?

NumPy is a Python library used for numerical computing. It provides support for arrays, matrices, and many mathematical functions to operate on these data structures efficiently. To install NumPy, you can use the pip package manager by running the command: pip install numpy in your command prompt or terminal.

2. What is an array and how is it different from a list? What is the name of the built-in array class in NumPy?

An array is a collection of elements of the same data type stored at contiguous memory locations. Unlike a Python list, which can hold elements of different data types and is more flexible but less efficient, a NumPy array (ndarray) is optimized for numerical operations and uses less memory. The built-in array class in NumPy is called 'ndarray' (N-dimensional array).

3. What do you understand by rank of an ndarray?

The rank of an ndarray refers to the number of dimensions or axes it has. For example, a 1-D array has rank 1, a 2-D array has rank 2, and so on. It indicates how many indices are needed to specify an element in the array.

4. Create the following NumPy arrays: a) A 1-D array called zeros having 10 elements and all the elements are set to zero. b) A 1-D array called vowels having the elements 'a', 'e', 'i', 'o' and 'u'. c) A 2-D array called ones having 2 rows and 5 columns and all the elements are set to 1 and dtype as int. d) Use nested Python lists to create a 2-D array called myarray1 having 3 rows and 3 columns and store the following data: 2.7, -2, -19 0, 3.4, 99.9 10.6, 0, 13 e) A 2-D array called myarray2 using arange() having 3 rows and 5 columns with start value = 4, step size 4 and dtype as float.

a) zeros = np.zeros(10)

b) vowels = np.array(['a', 'e', 'i', 'o', 'u'])

c) ones = np.ones((2,5), dtype=int)

d) myarray1 = np.array([[2.7, -2, -19], [0, 3.4, 99.9], [10.6, 0, 13]])

e) myarray2 = np.arange(4, 4 + 354, 4, dtype=float).reshape(3,5)

Explanation:

  • np.zeros(10) creates a 1-D array of 10 zeros.
  • np.array with list of vowels creates a 1-D array of characters.
  • np.ones with shape (2,5) and dtype int creates a 2-D array of ones.
  • Nested lists are passed to np.array to create mya

Ready to ace this chapter?

Get the full Introduction Chapter to NumPy chapter — interactive notes, diagrams, worked solutions, polls and a free practice quiz — in the ConceptScroll app.

Open in ConceptScroll →

Study smarter with ConceptScroll

Daily NCERT-aligned reels, AI doubt solving and chapter quizzes — all free.

Start learning free
#cbse notes#class 11#informatics practices#ncert

Continue reading