Professional Documents
Culture Documents
SAMPLE
SAMPLE
a) Write a program in python to create the following dataframe named “emp” storing the
details of employees:
Considering the above dataframe answer the following queries by writing appropriate command
in python pandas.
b) Add a new column named bonus (after salary column) which is 15% of their salary.
c)Display the details of Sales and Accounts department.
e) Now plot a bar chart depicting the employee name on x-axis and their corresponding Salary
(Rs.) on y-axis, with “Salary Analysis” as graph title, appropriate title for x-axis and y-axis. Also
make the color of bars “red”.
Q1. a) Write a program in python to create the following dataframe named “temp” storing the
following details:
Considering the above dataframe answer the following queries by writing appropriate command
in python pandas.
b) Add a new column named Humidity as [54, 65,70,75,71,59].
e) Now plot a bar chart depicting the City Name on x-axis and their corresponding
MaxTemp on y-axis, with “Temperature Analysis” as Graph title, “City” as x-axis title and “Max
temperature” as y-axis title and bar width as 0.25.
Q2. Consider the following tables STORE and ITEM.
Table: STORE
SNo SName Area
S01 ABC Computronics GK II
S02 ALL Infotech Media CP
S03 Tech Shoppe Nehru Place
S04 Geeks Tecno Soft Nehru Place
S05 Hitech Tech Store CP
Table: ITEM
INo IName Price SNo
T01 Mother Board 12000 S01
T02 Hard Disk 5000 S01
T03 Keyboard 500 S02
T04 Mouse 300 S01
T05 Mother Board 400 S03
T06 Key Board 400 S03
T07 LCD 6000 S04
T08 LCD 5500 S05
T09 Mouse 350 S05
T10 Hard Disk 4500 S03
Considering the above dataframe answer the following queries by writing appropriate command
in python pandas.
b) Add a Row with the following data values:
TName: Ms. Ritu Post: PRT Subject: Computer Salary: 35000 Dt_Join: 2019-01-06
c) Display Teacher Name, subject and Salary for all TGT teachers.
d) Add a new column Bonus which is 15% of their Salary.
e) Plot a line chart depicting the Teacher Name on x-axis and their corresponding
Salary on y-axis, with “Teacher wise Salary Analysis” as Graph title, “Teacher Name” as x-axis
title, “Salary” as y-axis title and make the line color “red”.