Class XII-final Practical File
Class XII-final Practical File
INFORMATICS PRACTICES
CLASS – XII
EX.NO: 1
DATE:
CREATING A SERIES USING DICTIONARY
AIM:
SOURCE CODE:
AN
RESULT:
U
Thus, the above Python program is executed successfully and the output is verified.
J
TE
SAMPLE OUTPUT:
JI
************************************************************************************************
lOMoARcPSD|29337657
EX.NO: 2
DATE:
CREATING A SERIES USING SCALAR VALUE
AIM:
To write a Python program to create a Series object that stores the Initial budget
allocated (50000/- each) for the four quarters of the year: Qtr1, Qtr2, Qtr3 and Qtr4.
SOURCE CODE:
RESULT:
AN
Thus, the above Python program is executed successfully and the output is verified.
U
SAMPLE OUPUT:
J
TE
JI
lOMoARcPSD|29337657
EX.NO: 3
DATE:
CREATING A SERIES USING NUMPY ARRAY
AIM:
To write a Python program to create a Series object that stores the Section names
('A','B','C') as the index and Contribution made by them respectively (6700,5500,nil) as
values.
SOURCE CODE:
AN
U
J
RESULT:
TE
Thus, the above Python program is executed successfully and the output is verified.
JI
SAMPLE OUTPUT:
*************************************************************************************************
lOMoARcPSD|29337657
EX.NO: 4
DATE:
AIM:
To create a program in python to perform following mathematical Operations on Two
Series objects: (i) Addition (ii) Subtraction (iii) Multiplication (iv) Division.
SOURCE CODE:
AN
U
J
TE
RESULT:
Thus, the above Python program is executed successfully and the output is verified.
JI
SAMPLE OUTPUT:
**************************************************************************************************
lOMoARcPSD|29337657
EX.NO: 5
DATE:
AIM:
To write a Python program to create a Series using list and display the following
attributes of the Series: (i) index (ii) dtype (iii) size (iv) shape (v) hasnans
SOURCE CODE:
AN
U
J
TE
RESULT:
Thus, the above Python program is executed successfully and the output is verified.
JI
SAMPLE OUTPUT:
*************************************************************************************************
lOMoARcPSD|29337657
EX.NO: 6
DATE:
AIM:
To write a Python program to create a Series using list of Marks of 10 students and
display first 5 Students’ marks and Last 2 Students’ marks from Series object.
SOURCE CODE:
AN
RESULT:
U
Thus, the above Python program is executed successfully and the output is verified.
J
TE
JI
SAMPLE OUTPUT:
**************************************************************************************************
lOMoARcPSD|29337657
EX.NO: 7
DATE:
AIM:
To write a Python program to create a panda’s Data Frame for the following table Using
Nested list:
SOURCE CODE:
AN
U
J
TE
RESULT:
JI
Thus, the above Python program is executed successfully and the output is verified.
SAMPLE OUTPUT:
**************************************************************************************************
lOMoARcPSD|29337657
EX.NO: 8
DATE:
AIM:
To write a Python program to create a panda’s DataFrame called DF for the following
table Using Dictionary of List and perform the following operations:
SOURCE CODE:
J
TE
JI
RESULT:
Thus, the above Python program is executed successfully and the output is verified.
lOMoARcPSD|29337657
SAMPLE OUTPUT:
AN
U
J
TE
*************************************************************************************************
JI
lOMoARcPSD|29337657
EX.NO: 9
DATE:
AIM:
To write a Python program to create a panda’s DataFrame called DF for the following
table Using Dictionary of List and perform the following operations:
(i) Insert a new column “Bags” with values as [5891, 8628, 9785, 4475].
SOURCE CODE:
U
J
TE
JI
RESULT:
Thus, the above Python program is executed successfully and the output is verified.
lOMoARcPSD|29337657
SAMPLE OUTPUT:
**************************************************************************************************
AN
U
J
TE
JI
lOMoARcPSD|29337657
EX.NO: 10
DATE:
AIM:
To write a Python program to create a panda’s DataFrame called DF for the following table
using Dictionary of List and display the details of students whose Percentage is more than
85.
SOURCE CODE:
AN
U
J
TE
JI
RESULT:
Thus, the above Python program is executed successfully and the output is verified.
SAMPLE OUTPUT:
*******************************************************************************************
lOMoARcPSD|29337657
EX.NO: 11
DATE:
AIM:
To write a Python program to create a DataFrame using Dictionary and display the
following attributes of the DataFrame: (i) index (ii) columns (iii) axes (iv) dtypes (v) shape (vi)
dimension (vii) T
SOURCE CODE:
AN
U
J
TE
RESULT:
JI
Thus, the above Python program is executed successfully and the output is verified.
SAMPLE OUTPUT:
*******************************************************************************************
lOMoARcPSD|29337657
EX.NO: 12
DATE:
To write a Python program to create a panda’s DataFrame called Students for the
following table and demonstrate iterrows and iteritems.
SOURCE CODE:
AN
U
J
TE
J I
RESULT:
Thus, the above Python program is executed successfully and the output is verified.
lOMoARcPSD|29337657
SAMPLE OUTPUT:
AN
U
J
TE
J I
**********************************************************************************************
lOMoARcPSD|29337657
EX.NO: 13
DATE:
SOURCE CODE: AN
U
J
RESULT:
TE
Thus, the above Python program is executed successfully and the output is verified.
JI
SAMPLE OUTPUT:
*********************************************************************************************
lOMoARcPSD|29337657
EX.NO: 14
DATE:
SOURCE CODE:
AN
U
J
TE
JI
RESULT:
Thus, the above Python program is executed successfully and the output is verified.
SAMPLE OUTPUT:
***********************************************************************************************
lOMoARcPSD|29337657
EX.NO: 15
DATE:
To write a Python program to plot a Multiple Bar chart for the following table. Also,
give Appropriate axes labels, title and legend.
SOURCE CODE:
AN
U
J
TE
JI
RESULT:
Thus, the above Python program is executed successfully and the output is verified.
SAMPLE OUTPUT:
***************************************************************************************************
lOMoARcPSD|29337657
EX.NO: 16
DATE:
PLOTTING HISTOGRAM
AIM:
To write a Python program to plot a Histogram for the following class interval or
range. Also, give appropriate axes name, title and edege color as ‘red’.
SOURCE CODE: AN
U
RESULT:
J
TE
Thus, the above Python program is executed successfully and the output is verified.
JI
SAMPLE OUTPUT:
*******************************************************************************************
lOMoARcPSD|29337657
EX.NO: 17
DATE:
To Write a Python program to store the details of Employess’ such as Empno, Name,
Salary into a Employee.csv file. Also, write a code to read employee details from csv
file.
SOURCE CODE:
AN
RESULT:
U
Thus, the above Python program is executed successfully and the output is verified.
J
SAMPLE OUTPUT:
TE
J I
**********************************************************************************************
lOMoARcPSD|29337657
Ex.No: 1
DATE:
SQL COMMANDS EXERCISE - 1
AIM:
To write Queries for the following Questions based on the given table:
Sol:
J I
(e) Write a Query to List all the tables that exists in the current database.
Sol:
mysql> SHOW TABLES;
Output:
(f) Write a Query to insert all the rows of above table into Info table.
Sol:
INSERT INTO INFO VALUES (1,'Praveen','M', 25,'Sales','1989-06-08','20000','Chennai');
(g) Write a Query to display all the details of the Employees from the above table 'INFO'.
JI
Sol:
Output:
*******************************************************************************************************
lOMoARcPSD|29337657
Ex.No: 2
DATE:
SQL COMMANDS EXERCISE - 2
AIM:
To write Queries for the following Questions based on the given table:
(a) Write a Query to Display Employees’ name and City from the above table.
Sol:
AN
Output:
J
TE
JI
(b) Write a Query to Display all details of Employees who are living in Chennai.
Sol:
Output:
lOMoARcPSD|29337657
(c) Write a Query to get the name and salary of the employee whose salary is above 15000
and gender is not male.
Sol:
Output:
(d) Write a query to update increase 10% Salary of an employee whose City is 'CHENNAI'
and Gender is 'MALE'.
Sol:
AND GENDER='MALE';
Ex.No: 3
DATE:
SQL COMMANDS EXERCISE - 3
AIM:
To write Queries for the following Questions based on the given table:
Output:
U
J
TE
JI
Output:
(c) Write a Query to display maximum salary and minimum salary of employees.
Sol:
mysql> SELECT MAX(SALARY),MIN(SALARY) FROM INFO;
Output:
lOMoARcPSD|29337657
(d) Write a Query to count the number of employees earning more than 25000.
Sol:
mysql> SELECT COUNT(SALARY) FROM INFO WHERE SALARY>25000;
Output:
(e) Write a query to display sum of salary of the employees grouped by department wise.
Sol:
mysql> SELECT DEPT,SUM(SALARY) FROM INFO GROUP BY DEPT;
Output:
AN
(f) Write a query to display the department names where number of employees are greater
U
than or equal to 2.
J
Sol:
TE
Output:
****************************************************************************************
lOMoARcPSD|29337657
Ex.No: 4
DATE:
SQL COMMANDS EXERCISE - 4
AIM:
To write Queries for the following Questions based on the given table:
(b) Write a Query to display department name and its respective number of characters in
Dept column.
Sol:
Output:
lOMoARcPSD|29337657
Sol:
mysql> SELECT LEFT(NAME,2) FROM STU;
Output:
Sol:
Output:
U
J
TE
JI
(e) Write a Query to display name of all the students from 3rd character to 5th character in
the field Name of the STU table.
Sol:
Output:
lOMoARcPSD|29337657
(f) Write a Query to display student name and month of date of admission of all students.
Sol:
Output:
(g) Write a Query to display Student name and day name of the students’ DOA of the table
STU.
Sol:
mysql> SELECT NAME,DAYNAME(DOA) FROM STU;
AN
Output:
U
J
TE
JI
(h) Write a Query to display Student name and month name of the students’ DOA of the
table STU.
Sol:
Output:
*********************************************************************************************