Informatics Practices Practical File Class 12th - Pandas, Matplotlib & SQL Questions With Solutions
Informatics Practices Practical File Class 12th - Pandas, Matplotlib & SQL Questions With Solutions
PRACTICAL FILE
Output
Output
Q3. Create a panda’s series from a dictionary of values and a ndarray.
Sol.
Output
Q4. Given a Series, print all the elements that are above the 75th percentile.
Sol.
Output
Q6. Create a data frame for examination results and display row labels,
column labels datatypes of each column and the dimensions.
Sol.
Output
Q7. Create the following DataFrame Sales containing year wise sales figures
for five salespersons in INR. Use the years as column labels, and
salesperson names as row labels.
2018 2019 2020 2021
Output
Output
Output
5. Display the dimensions, shape, size and values of Sales.
Sol.
Output
Output
2. Display the first two columns of Sales.
Sol.
Output
Output
2. Display the sales made by all sales persons in the year 2018.
Sol.
Output
3. Display the sales made by Kapil and Mohini in the year 2019 and 2020.
Sol.
Output
4. Add data to Sales for salesman Nirali where the sales made are [221, 178,
165, 177, 210] in the years (2018, 2019, 2020, 2021] respectively.
Sol.
Output
5. Delete the data for the year 2018 from the DataFrame Sales.
Sol.
Output
6. Delete the data for sales man Shikhar from the DataFrame Sales.
Sol.
Output
7. Change the name of the salesperson Kamini to Rani and Kapil to Anil.
Sol.
Output
Output
Q11. Write a Pandas program to compare the elements of the two Pandas Series.
Sol.
Output
Q12. Write a Pandas program to sort a given Series
Sol.
Output
Output
Q15. Write a Pandas program to add some data to an existing Series.
Sol.
Output
Q16. Plot the following data on a line chart and customize the chart
according to the below given instructions:
Month January February March April May
Sol.
Output
Q17. Pratyush Garments has recorded the following data into their register
for their income from cotton clothes and jeans. Plot them on the line
chart.
Day Monday Tuesday Wednesday Thursday Friday
Sol.
Output
Q18. Observe the given data for monthly views of one of the youtube
channels for 6 months. Plot them on the line chart.
Month January February March April May June
Sol.
Output
Q19. Observe the following data and plot data according to the given
instructions:
Batsman 2017 2018 2019 2020
Virat Kohli 2501 1855 2203 1223
Steve Smith 2340 2250 2003 1153
Babar Azam 1750 2147 1896 1008
Rohit Sharma 1463 1985 1854 1638
Kane Williamson 1256 1785 1874 1974
1. Create a bar chart to display data of Virat Kohli and Rohit Sharma
Sol.
Output
2. Create a bar chart to display data of Steve Smith, Kane Williamson and
Jos Buttler. Customize chart as per your wish.
Sol.
Output
Output
Q20. Write SQL commands for (a) to (j) and write output for (k) to (n) on
the basis of Teacher relation given below:
No Name Age Department Date_of_join Salary Sex
1 Jugal 34 Computer 10/01/97 12000 M
2 Sharmila 31 History 24/03/98 20000 F
3 Sandeep 32 Maths 12/12/96 30000 M
4 Sangeeta 35 History 01/07/99 40000 F
5 Rakesh 42 Maths 05/09/97 25000 M
6 Shyam 50 History 27/06/98 30000 M
7 Shivom 44 Computer 25/02/97 21000 M
Output
(b) To list the names of all teachers with their date of joining in
ascending order.
Sol.
Output
(c) To display Teacher’s name, salary, age for male teachers only.
Sol.
Output
(e) To insert a new row in the teacher table with the following data:
8, “Vijay”, 26, “Computer”,{13/05/95}, 35000, “M”
Sol.
Output
Output
(g) To list the name of female teachers who are in history
department.
Sol.
Output
Output
(j) Display the Age of the teachers whose name starts with ‘S’.
Sol.
Output
Output
Output
Output