CAMBRIDGE SCHOOL (C.B.S.
E)
GREATER NOIDA
SESSION:-2021-22
INFORMATICS PRACTICES
SUB. CODE - 065
PRACTICAL FILE
NAME: Vedant Joshi
CLASS: XII SECTION : A
BOARD ROLL NO:-
1
Certificate
This is to certify that Vedant Joshi, Roll No: 38 of
Class: A, Session: 2022-23
has prepared the Practical file as per the prescribed
practical syllabus of
INFORMATICS PRACTICES (065) Class XII (C.B.S.E.)
under my supervision, I am completely satisfied by the
performance.
I wish him all the success in life.
Principal’s Subject Teacher’s
Signature Signature
2
Acknowledgement
I would like to express my special thanks of
gratitude to my teacher Ms. Akansha Aggarwal as
well as our principal Ms. Snehlata Krishnan who gave
me the golden opportunity to do this wonderful
Practical file on the topic python and it’s library,
which also helped me in doing a lot of Research
and I came to know about so many new things I
am really thankful to them.
Secondly i would also like to thank my parents
and friends who helped me a lot in finalizing this
Practical within the limited time frame.
Vedant Joshi
3
INDEX PAGE
Section-A (PYTHON)
TEACHER’S
SL PAGE
No Practical Name NO.
SIGNATURE
Write a program to create a Series object
1 using an Nd-array that has 10 elements 7
in the range 100 to 200?
Write a program to create a series to store
the number of students enrolled in 8
games during summer camp. The game
2 8
names are the indexes and the number of
students as the data. The data is stored
in a python list.
Write a program to create a Series object
using a dictionary that stores the number
3 9
of students in each section of class 12 in
your school?
Consider the series object S that stores
the contribution of each section, as
shown below: A 4300 B 6500 C 3900 D
4 9-10
6100 Write code to modify the amount of
section ‘A’ as 3400 and for section ‘C’ and
‘D’ as 5000. Print the changed object.
Write a program to create a Data Frame
Quarterly Sales where each row contains
5 the Quarterly Sales of TV, Freeze and AC. 10
Show the DataFrame after deleting details
of Freeze.
Write a menu driven Pandas program to
6 sort data series according to the value 11-14
and index.
4
Write a program to create a DataFrame to
store Roll Number, Name and Marks of
7 15
five students. Print the DataFrame and its
transpose.
Write a Pandas program to add, subtract,
8 16-20
multiple and divide two Pandas Series.
Write a program to create a DataFrame
from a CSV file. Display the shape
9 20
(Number of rows and columns) of the CSV
file.
Write a program to create a DataFrame
which contains RollNumber, Name,
10 21
Height and Weight of 05 students. Create
a CSV file using this DataFrame
Write a Python Program to create the
11 dataframe and selecting rows/column 22
using loc and iloc function.
Write a menudriven program to extract
12 data from dataframe Rowwise() and 23-27
column wise.
Write a program to create a DataFrame
with two columns name and age. Add a
13 28
new column Updated Age that contains
age increased by 10 years.
Given a DataFrame (df ) as under: 2. City
Schools Delhi 7654 Mumbai 8700 Kolkata
9800 Chennai 8600 Write a program to
14 29-30
print DataFrame one row at a time. Also
display first two rows of City column and
last two rows of Schools column.
5
In an online contest, two 2-player teams’
point in 4 rounds are stored in two
15 DataFrames as shown below: 30
Write a program to calculate total points
earned by both the teams in each round.
Given the school result data, analyses the
performance of the students in
Accountancy and Business studies using
16 31
bar graph. Given marks are
Accountancy=[94,85,45,25,50,54]
BusinessStudy =[98,76,34,65,55,88]
Write a program to plot a bar chart from
the medals won by four countries. Type of
17 medals won by countries are 'Gold','Silver' 32
and 'Bronze'. Make sure that bars are
separately visible.
Write a program to plot a bar chart in
18 python to display the result of a school for 33
five consecutive years.
A survey gathers height and weight of 60
participants and recorded the
participants’ ages as: Ages =
[1,1,2,3,5,7,8,9,10,10,11,13,13,15,16,
17,18,19,20,21,21,23,24,24,24,25,25,25,
19 25,26, 34
26,26,27,27,27,27,27,29,30,30,30,30,31,
33,34,
34,34,35,36,36,37,37,37,38,38,39,40,40,
41,41]6 Write a program to plot a
histogram from above data with 20 bins.
Given datasets population of India and
Pakistan in the given years. Show the
20 population of India and Pakistan using 35
line chart with title and labels of both
axis.
TEACHER’S SIGNATURE
6
Section-A PYTHON
PRACTICAL NO 1. Write a program to create a Series object using an Nd-array that has
10 elements in the range 100 to 200?
Code:
Output:
7
PRACTICAL NO 2. Write a program to create a series to
store the number of students enrolled in 8 games during
summer camp. The game names are the indexes and the
number of students as the data. The data is stored in a
python list.
Code:
Output:
8
Practical No 3. Write a program to create a Series object
using a dictionary that stores the number of students in each
section of class 12 in your school?
Code:
Output:
Practical No 4. Consider the series object S that stores the
contribution of each section, as shown below: A 4300 B 6500
C 3900 D 6100 Write code to modify the amount of section ‘A’
as 3400 and for section ‘C’ and ‘D’ as 5000. Print the changed
object.
Code:
Output:
9
Practical No 5. Write a program to create a Data Frame
Quarterly Sales where each row contains the Quarterly Sales
of TV, Freeze and AC. Show the DataFrame after deleting
details of Freeze.
Code:
Output:
10
Practical No 6. Write a menu driven Pandas program to sort
data series according to the value and index.
Code:
11
12
Output:
13
14
Practical No 7. Write a program to create a DataFrame to
store Roll Number, Name and Marks of five students. Print the
DataFrame and its transpose.
Code:
Output:
15
Practical No 8. Write a Pandas program to add, subtract,
multiple and divide two Pandas Series.
Code:
16
17
18
Output:
19
20
21
Practical No 9. Write a program to create a DataFrame from a
CSV file. Display the shape (Number of rows and columns) of
the CSV file.
Code:
Output:
22
Practical No 10. Write a program to create a DataFrame
which contains RollNumber, Name, Height and Weight of 05
students. Create a CSV file using this DataFrame
Code:
Output:
CSV:
23
Practical No 11. Write a Python Program to create the
dataframe and selecting rows/column using loc and iloc
function.
Code:
Output:
24
Practical No 12. Write a menudriven program to extract data
from dataframe Rowwise() and column wise.
Code:
25
26
27
Output:
28
29
30
Practical No 13. Write a program to create a DataFrame with
two columns name and age. Add a new column Updated Age
that contains age increased by 10 years.
Code:
Output:
31
Practical No 14. Given a DataFrame ( df ) as under: 2. City
Schools Delhi 7654 Mumbai 8700 Kolkata 9800 Chennai 8600
Write a program to print DataFrame one row at a time. Also
display first two rows of City column and last two rows of
Schools column.
Code:
32
Output:
33
Practical No 15. In an online contest, two 2-player teams’
point in 4 rounds are stored in two DataFrames as shown
below: Write a program to calculate total points earned by
both the teams in each round.
Code:
34
Output:
35
Practical No 16. Given the school result data, analyses the
performance of the students in Accountancy and Business
studies using bar graph. Given marks are
Accountancy=[94,85,45,25,50,54]
BusinessStudy=[98,76,34,65,55,88]
Code:
Graph:
36
Practical No 17. Write a program to plot a bar chart from the
medals won by four countries. Type of medals won by
countries are 'Gold','Silver' and 'Bronze'. Make sure that bars
are separately visible.
Code:
Graph:
37
Practical No 18. Write a program to plot a bar chart in python
to display the result of a school for five consecutive years.
Code:
Graph:
38
Practical No 19. A survey gathers height and weight of 60
participants and recorded the participants’ ages as: Ages =
[1,1,2,3,5,7,8,9,10,10,11,13,13,15,16,
17,18,19,20,21,21,23,24,24,24,25,25,25,25,26,
26,26,27,27,27,27,27,29,30,30,30,30,31,33,34,
34,34,35,36,36,37,37,37,38,38,39,40,40,41,41] Write a
program to plot a histogram from above data with 20 bins
Code:
Graph:
39
Practical No 20. Given datasets population of India and
Pakistan in the given years. Show the population of India and
Pakistan using line chart with title and labels of both axis.
Code:
Graph:
40