XII Practical List Programs
XII Practical List Programs
NEPANAGAR
2. 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?
3. Consider the series object S that stores the contribution of each section, as
shown below:
Write code to modify the amount of section ‘A’ as 3400 and for section ‘C’ and ‘D’ as
5000. Print the changed object.
4. 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.
5. Write a program to create a DataFrame to store Roll Number, Name and Marks
of five students. Print the DataFrame and its transpose.
6. Write a program to create a DataFrame from a CSV file. Display the shape
(Number of rows and columns) of the CSV file.
7. Name, Height and Weight of 05 students. Create a CSV file using this
DataFrame.
8. Given the school result data, analyses the performance of the students in
Accountancy and Business studies using bar graph.
9. 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.
10. Write a program to plot a bar chart from the medals won by four
countries. Make sure that bars are separately visible.
11. 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,
8,38,39,40,40,41,41]
Write a program to plot a histogram from above data with 20 bins.
12. Write a program to create data series and then change the indexes of the
Series object in any random order.
13. 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.
14. 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.
15. Given a DataFrame ( df ) as under:
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.
16. Write a program to plot a horizontal bar chart from heights of some
students.
24. Consider the following tables HOSPITAL. Write SQL commands for (i) to
(vi) and give outputs for SQL queries (vii) to (x).
(i) To show all information about the patients whose names are having six characters
only.
(ii) To reduce Rs. 200 from the charge of female patients who are in Cardiology
department.
(iii) To insert a new row in the above table with the following data :
11, ‘Rakesh’, 45, ‘ENT’, {08/08/08}, 1200, ‘M’
(iv) To remove the rows from the above table where age of the patient > 60.
(v) fetch department wise number of patients.
(vi) fetch total male patients in surgery and cardiology department.
(vii) Select SUM(Charge) from HOSPITAL where Sex=’F’;
(vii) Select COUNT(DISTINCT Department ) from HOSPITAL;
(ix) Select Department, SUM(Charge) from HOSPITAL group by Department;
(x) Select Name from HOSPITAL where Sex=’F’ AND Age > 20;