Data Handling using Pandas - I
CBSE · Class 12 · Informatics Practices
NCERT Solutions for Data Handling using Pandas - I — CBSE Class 12 Informatics Practices.
Interactive on Super Tutor
Studying Data Handling using Pandas - I? Get the full interactive chapter.
Quizzes, flashcards, AI doubt-solver and a step-by-step study plan — built for ncert solutions and more.
1,000+ Class 12 students started this chapter today
23 worked solutions below. Unlock all 46 free in Super Tutor
Exercise
1What is a Series and how is it different from a 1-D array, a list and a dictionary?Show solution
Differences:
- 1-D array (NumPy ndarray): stores elements in a one-dimensional form, but uses only integer positions for indexing.
- List: a general Python collection; it does not provide Pandas-style labeled indexing and built-in data analysis methods.
- Dictionary: stores key:value pairs, while a Series stores values with an index. A Series can be created from a dictionary, but it is not the same thing.
Not sure why a step works? check your working in Super Tutor
2What is a DataFrame and how is it different from a 2-D array?Show solution
Difference from a 2-D array:
- A 2-D array usually stores homogeneous data and is accessed mainly by numeric positions.
- A DataFrame can store different data types in different columns and uses row and column labels for easier access and analysis.
Not sure why a step works? check your working in Super Tutor
3How are DataFrames related to Series?Show solution
- A DataFrame can be thought of as a collection of Series.
- Each column in a DataFrame is a Series.
- When a DataFrame is created from a dictionary of Series, the resulting rows and columns are formed by combining those Series.
Not sure why a step works? check your working in Super Tutor
4What do you understand by the size of (i) a Series, (ii) a DataFrame?Show solution
- For a Series, size = the number of elements in it.
- For a DataFrame, size = the total number of values in all rows and columns, i.e. rows × columns.
Not sure why a step works? check your working in Super Tutor
5aEngAlph, having 26 elements with the alphabets as values and default index values.Show solution
import pandas as pd
EngAlph = pd.Series(list('abcdefghijklmnopqrstuvwxyz'))
print(EngAlph)
```
Not sure why a step works? check your working in Super Tutor
5bVowels, having 5 elements with index labels 'a', 'e', 'i', 'o' and 'u' and all the five values set to zero. Check if it is an empty series.Show solution
import pandas as pd
Vowels = pd.Series([0, 0, 0, 0, 0], index=['a', 'e', 'i', 'o', 'u'])
print(Vowels)
print(Vowels.empty)
```
`Vowels.empty` will be False because the Series has 5 values, so it is not empty.
Not sure why a step works? check your working in Super Tutor
5cFriends, from a dictionary having roll numbers of five of your friends as data and their first name as keys.Show solution
import pandas as pd
Friends = pd.Series({'Aman': 12, 'Riya': 15, 'Kunal': 8, 'Meena': 20, 'Tarun': 11})
print(Friends)
```
The dictionary keys become the index labels of the Series.
Not sure why a step works? check your working in Super Tutor
5dMTseries, an empty Series. Check if it is an empty series.Show solution
import pandas as pd
MTseries = pd.Series()
print(MTseries)
print(MTseries.empty)
```
`MTseries.empty` will be True because the Series has no values, so it is an empty Series.
Not sure why a step works? check your working in Super Tutor
5eMonthDays, from a numpy array having the number of days in the 12 months of a year. The labels should be the month numbers from 1 to 12.Show solution
import pandas as pd
import numpy as np
MonthDays = pd.Series(np.array([31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]), index=range(1, 13))
print(MonthDays)
```
Not sure why a step works? check your working in Super Tutor
6aSet all the values of Vowels to 10 and display the Series.Show solution
Vowels[:] = 10
print(Vowels)
```
This sets all values in the Series to 10.
Not sure why a step works? check your working in Super Tutor
6bDivide all values of Vowels by 2 and display the Series.Show solution
Vowels = Vowels / 2
print(Vowels)
```
Since all values of `Vowels` are 10 after the previous step, dividing by 2 gives 5 in each position.
Not sure why a step works? check your working in Super Tutor
6cCreate another series Vowels1 having 5 elements with index labels 'a', 'e', 'i', 'o' and 'u' having values [2,5,6,3,8] respectively.Show solution
Vowels1 = pd.Series([2, 5, 6, 3, 8], index=['a', 'e', 'i', 'o', 'u'])
print(Vowels1)
```
Not sure why a step works? check your working in Super Tutor
6dAdd Vowels and Vowels1 and assign the result to Vowels3.Show solution
Vowels3 = Vowels + Vowels1
print(Vowels3)
```
This adds the two Series after matching their index labels and stores the result in `Vowels3`.
Not sure why a step works? check your working in Super Tutor
6eSubtract, Multiply and Divide Vowels by Vowels1.Show solution
Vowels - Vowels1
Vowels * Vowels1
Vowels / Vowels1
```
These are the commands for subtraction, multiplication and division of `Vowels` by `Vowels1`.
Not sure why a step works? check your working in Super Tutor
6fAlter the labels of Vowels1 to ['A', 'E', 'I', 'O', 'U'].Show solution
Vowels1.index = ['A', 'E', 'I', 'O', 'U']
print(Vowels1)
```
This changes the index labels of `Vowels1` to the given uppercase labels.
Not sure why a step works? check your working in Super Tutor
7aFind the dimensions, size and values of the Series EngAlph, Vowels, Friends, MTseries, MonthDays.Show solution
```python
EngAlph.ndim, EngAlph.size, EngAlph.values
Vowels.ndim, Vowels.size, Vowels.values
Friends.ndim, Friends.size, Friends.values
MTseries.ndim, MTseries.size, MTseries.values
MonthDays.ndim, MonthDays.size, MonthDays.values
```
Not sure why a step works? check your working in Super Tutor
7bRename the Series MTseries as SeriesEmpty.Show solution
MTseries.name = 'SeriesEmpty'
print(MTseries)
```
This assigns the Series name SeriesEmpty.
Not sure why a step works? check your working in Super Tutor
7cName the index of the Series MonthDays as monthno and that of Series Friends as Fname.Show solution
MonthDays.index.name = 'monthno'
Friends.index.name = 'Fname'
```
This names the index of `MonthDays` as monthno and that of `Friends` as Fname.
Not sure why a step works? check your working in Super Tutor
7dDisplay the 3rd and 2nd value of the Series Friends, in that order.Show solution
```python
Friends[[2, 1]]
```
Not sure why a step works? check your working in Super Tutor
7eDisplay the alphabets 'e' to 'p' from the Series EngAlph.Show solution
```python
EngAlph['e':'p']
```
In label slicing, the end label is included.
Not sure why a step works? check your working in Super Tutor
7fDisplay the first 10 values in the Series EngAlph.Show solution
```python
EngAlph.head(10)
```
Not sure why a step works? check your working in Super Tutor
7gDisplay the last 10 values in the Series EngAlph.Show solution
```python
EngAlph.tail(10)
```
Not sure why a step works? check your working in Super Tutor
7hDisplay the MTseries.Show solution
```python
print(MTseries)
```
Not sure why a step works? check your working in Super Tutor
23 more solved questions in Data Handling using Pandas - I
Every remaining exercise is solved step by step in Super Tutor, plus practice quizzes and flashcards for this chapter. Free to start.
Stuck on a step?
Ask Super Tutor AI to explain any solution on this page in a simpler way — free, 24x7.
Ask a Doubt FreeFrequently Asked Questions
What are the important topics in Data Handling using Pandas - I for CBSE Class 12 Informatics Practices?
How to score full marks in Data Handling using Pandas - I — CBSE Class 12 Informatics Practices?
Where can I get free NCERT Solutions for Data Handling using Pandas - I Class 12 Informatics Practices?
Sources & Official References
- NCERT Official — ncert.nic.in
- CBSE Academic — cbseacademic.nic.in
- CBSE Official — cbse.gov.in
- National Education Policy 2020 — education.gov.in
Content is aligned to the official syllabus. Refer to the board website for the latest curriculum.
More resources for Data Handling using Pandas - I
Practice Quiz
Test yourself with a quick quiz
Important Questions
Practice with board exam-style questions
Revision Notes
Key points for last-minute revision
Formula Sheet
All formulas in one place
Chapter Summary
Understand the chapter at a glance
Concept Maps
See how topics connect visually
Study Plan
Step-by-step plan to ace this chapter
Flashcards
Quick-fire cards for active recall
Syllabus
What topics to cover
For serious students
Get the full Data Handling using Pandas - I chapter — for free.
Quizzes, flashcards, AI doubt-solver and a step-by-step study plan for CBSE Class 12 Informatics Practices.