Complete Practical File of Class XII-IP 2020-21
Complete Practical File of Class XII-IP 2020-21
Complete Practical File of Class XII-IP 2020-21
in
Informatics practices-065
for
Session 2020-21
Roll.No-________________
__________________
Signature of External
Index
2
S.No. Practical Description Page Teacher's
No. Sign.
Section-A (Data
Visualization)
1
2
3
4
..
..
Section-B (Python Pandas)
..
..
..
..
..
..
Section-C (SQL Commands)
..
..
..
3
Section-A
DATA VISUALIZATION
4
PRACTICAL NO-1
5
OUTPUT:
6
PRACTICAL NO-2
7
Problem Definition : Given the
following data of rainfall in
different zones of India in mm for
12 months.
Create multiple line charts in a
Figure to observe any trends from
Jan to Dec.
CODING:
8
OUTPUT:
9
PRACTICAL NO-3
CODING:
10
OUTPUT:
11
PRACTICAL NO-4
OUTPUT:
13
PRACTICAL NO-5
14
•Problem Definition : Given the
ages of 50 participants in some
game. Write a program to plot
a histogram from given data
with 10 bins.
Data =
[ 10,11,13,13,15,16,17,18,19,21,23,23,23,2
4,24,25,25,25,25,25,26,26,27,27,27, 27,
29,30,30,30,30,31,33,34,34,35,36,36,37,37,
37, 38,39,40,40,40,41,42,43,43]
15
OR
OUTPUT:
16
1
PRACTICAL NO-6
17
•Problem Definition : Given
below are the sugar levels for
men and women in a city.
Compare the sugar levels
amongst them.
men =
[113,85,90,150,149,88,93,115,135,80,77,8
2,129]
women=[67,98,89,120,133,150,84,69,89,79,
120,112,100]
CODING:
18
OR
OUTPUT:
19
1
20
Section-B
PYTHON PANDAS
PRACTICAL NO-7
21
•Problem Definition : Create a
Series from a Dictionary and
another series using n-d array.
( Create the dictionary with
month name as key and no. of
days as value and create a 1-d
array of n integers.)
CODING:
22
OUTPUT:
23
PRACTICAL NO-8
Problem Definition : Create two Series, one from array and
another from List object, one with default index and another with
user defined index, one int data dtype and another string data type.
Now print the following attributes in the given format.
Attribute Name Series1 Series2
Data type :
Shape :
No. of bytes
No. of Dimensions
Has NaNs ?
Empty?
Index
values
CODING:
24
OUTPUT:
25
26
PRACTICAL NO-9
CODING:
27
OUTPUT:
28
PRACTICAL NO-10
29
Problem Definition : Define two
series named Population Storing the
population of 4 metro cities of India and
AvgIncome stores the total average
income reported in previous year in each
of these 4 cities. Calculate income per
capita for each of these metro cities.
Print it in the following tabular form.
(Take real data from the net)
CODING:
30
OUTPUT:
31
PRACTICAL NO-11
32
Problem Definition : Create a
Series that stores the area of all
states of India in km2. Create this
series through user's input. Now
find out the biggest and the
smallest area of 3 states. Also
find out the area and states
having area more than 5000 km . 2
CODING:
33
INPUT:
34
35
OUTPUT:
36
37
PRACTICAL NO-12
PROBLEM DEFINITION:
CODING:
38
OUTPUT:
39
40
41
PRACTICAL NO-13
PROBLEM DEFINITION:
42
INPUT:
43
OUTPUT:
44
PRACTICAL NO-14
PROBLEM DEFINITION:
CODING:
45
46
OUTPUT:
47
48
PRACTICAL NO-15
PROBLEM DEFINITION:
Write a Python program to create a
DataFrame as given below, and display all
its attributes ( index, columns, shape,
size, axes, rows and columns.
CODING:
49
OUTPUT:
50
PRACTICAL NO-16
PROBLEM DEFINITION:
51
OUTPUT:
52
53
54
Write a Python Program to create the following
DataFrame namely aid_df that stores the aid by
PRACTICAL
NGOs for different states. NO-17
PROBLEM
Now DEFINITION
display the following:
a) Show the data of toy column
b) Show the data of Books and Uniform columns
c) Show the data of Toys and Uniform Column for
top 3 rows ( Use loc)
d) Show the data of first 3 rows and first 3
columns( using iloc)
e) Now set the state as index and display the
dataframe
f) Now show the data for Toys, Uniform and Shoes
columns of Andhra ,bihar and W.B
e) Now reset the index and show the dataframe
CODING:
55
OUTPUT:
56
57
Create the following Data Frame
PRACTICAL NO-18
showing
PROBLEM quarterly
DEFINITION : sale year-wise, now
write python code as per the given
questions.
a) Display the data frame .
b) Now write a menu driven program to extract data
from dataframe a) Row-wise b) Row-wise Series
object ( Using iterRows() function).
c) Similarly Perform iteration column wise also. ( Use
iteritems() functions, make menu driven)
The output should appear as under:
CODING :
58
OUTPUT:
59
60
61
PRACTICAL NO-19
PROBLEM DEFINITION :
62
OUTPUT:
63
64
65
Create a data PRACTICAL
frame as per given row and
NO-20
columns
PROBLEM in it. Display
DEFINITION : it. Now perform the
following by writing python code.
a) Add a column Total showing sum of marks of all subjects.
b) Now increase 5 marks in the 'Total' column for all
students.
c) Add one more column Percentage, calculated on the
basis of 'Total' marks obtained out of 500.
d) Add a new row in the above DataFrame.( Using loc)
e) Add two more rows together in the above dataFrame.
( Using append)
f) Now modify the English marks of Thomas as 70,
accordingly update his Total and percentage.
g) Now display the DataFrame.
CODING :
66
OUTPUT:
67
68
PRACTICAL NO-21
PROBLEM DEFINITION :
69
OUTPUT:
70
71
Section-C
72
SQL Commands
Q.1- Create a database 'School' on the database server, show the list of databases and open
it.
Q 2- Create the following table named 'STUDENT' with appropriate data type, size and
constraint(s) if any.
73
Q.3- insert the following records into the table.
Q.4- Display all the information of males whose city is NEITHER Delhi or Mumbai.
Q.5- Display the details of all the students whose date of birth is after Nishant’s Birth date 1995-12-
06. (consider the Sql’s standard date format)
74
Q.6- Display all information about class XII students rank wise.
Q.7- Display all columns arranged in descending order of city and within the city in the ascending
order their marks.
Q.8- List names of all students whose name has the character ‘a’.
75
Q.9- Display Name and Marks of those students whose marks is in the range 400 and 500 ( both are
inclusive)
Q.10- Display average marks, highest marks and total no. of students for each class
Q.11- Display total no of males and females separately, along with their average marks.
76
Q.13- Add a new column named Address. ( Take the data type and size yourself)
Q.15- Display name, class and city of 'XII' class students who lives in 'Mumbai'.
77
Q.16- Display unique sex names.
Q.17- Display name, data of birth and day name (like Sunday, Monday,.), of all females, whose
marks is greater than or equal to 400.
Q.18- Display City and highest marks of students of each city, but only for Delhi and Mumbai.
78
Q.19- Display round of average marks up to zero places, truncate of average marks up to 1 decimal
place for class 'X' students only.
Q.20- Write a query to display name and the position of character 'a' in the names of students
having 'a' anywhere in their names.
Q.21- Display name, character number 3rd and 4th of each name and counting of number of
characters in each name.
79
Q.22- Display current date and current time together.
Q.23- Display name, marks and round up the Square root of marks up to 2 decimal places
Teacher's Signature:
_____________________
80