Practical Exam Papers (2024)(Set - 1 and 2)with solutions
Practical Exam Papers (2024)(Set - 1 and 2)with solutions
SET - 1
Q1. Programs using Pandas and Matplotlib
(A) Write a program in Python to create the following DataFrame named EMP storing [3]
the details of employees:
Considering the above DataFrame, answer the following queries by writing appropriate
command in Python Pandas.
(i) Add a new column named Bonus which is 15% of their Salary. [1]
(ii) Add a row with index 1008 as Akhilesh, Analyst, 80000, 2012-07-12, Admin. [1]
(B) Display Bar Chart: EName (X-axis) Vs. Salary (Y-axis). [3]
Also Display Proper Title, X-label, Y-label as well as all bars in Red colour.
ANSWER:
import pandas as pd
data = {
EMP = pd.DataFrame(data,index=[1001,1002,1003,1004,1005,1006,1007])
print(EMP)
# (i) Add a new column named Bonus which is 15% of their Salary.
print(EMP)
# (ii) Add a row with index 1008 as Akhilesh, Analyst, 80000, 2012-07-12, Admin.
print(EMP)
plt.title('Employee Salary')
plt.xlabel('Employee Name')
plt.ylabel('Salary')
plt.show()
i) To list the Name, Class, and Stipend of those students who are in class 12 sorted by Stipend:
SELECT Name, Class, Stipend
FROM STUDENT
WHERE Class = '12'
ORDER BY Stipend;
(ii) To count the number of students by Class and Stream:
SELECT Class, Stream, COUNT(*) AS Count
FROM STUDENT
GROUP BY Class, Stream;
❖
SSCE PRACTICAL EXAM – 2024
SUBJECT: INFORMATICS PRACTICES (065)
(SET-2)
Grade: XII (Commerce) Duration: 3 Hours
Day & Date: Tuesday, 16th February’24 Max. Marks: 30
SET - 2
Q1. Programs using Pandas and Matplotlib
(A) Write a program in python to create the following DataFrame named TEACHER [3]
storing the following details:
Considering the above DataFrame, answer the following queries by writing appropriate
command in Python Pandas.
(i) Add a new column named Bonus which is 10% of their Salary. [1]
(ii) Add a row with index 108 as Mr. Abhishek Pathak, PGT, English, 30000, 2019-04-01. [1]
(B) Display Line Chart: TName (X-axis) Vs. Salary (Y-axis). [3]
Also Display Proper Title, X-label, Y-label as well as solid line and dot marker in Blue Colour.
ANSWER:
import pandas as pd
data_teacher = {
'TName': ['Mr. P K Sharma', 'Mr. Krish Sinha', 'Ms. Sneha Reddy', 'Ms. Neeti Shah', 'Ms. Nidhi Patel', 'Mr. R K
Khanna', 'Mrs. V K Gupta'],
TEACHER = pd.DataFrame(data_teacher,index=[101,102,103,104,105,106,107])
print(TEACHER )
# (i) Add a new column named Bonus which is 10% of their Salary.
print(TEACHER)
# (ii) Add a row with index 108 as Mr. Abhishek Pathak, PGT, English, 30000, 2019-04-01.
print(TEACHER)
plt.title('Teacher Salary')
plt.xlabel('Teacher Name')
plt.ylabel('Salary')
plt.show()
❖