0% found this document useful (0 votes)
31 views3 pages

XII Practical Questions

The document outlines 15 programs involving pandas Series and DataFrames to analyze and visualize different datasets: 1. Stores temperature data in weeks in Series and calculates average weekly and monthly temperatures. 2. Stores monthly sales data of items in Series and reports total yearly sales, best selling item and month, and monthly item sales. 3. Stores student marks in terms in Series, calculates weighted total marks, and adds to a Series. 4. Demonstrates pandas Series attributes. 5. Solves problems from a textbook on Series. 6. Merges two DataFrames on a common column. 7. Creates charts like scatter, line, and bar from a DataFrame.

Uploaded by

Deepti Sharma
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
31 views3 pages

XII Practical Questions

The document outlines 15 programs involving pandas Series and DataFrames to analyze and visualize different datasets: 1. Stores temperature data in weeks in Series and calculates average weekly and monthly temperatures. 2. Stores monthly sales data of items in Series and reports total yearly sales, best selling item and month, and monthly item sales. 3. Stores student marks in terms in Series, calculates weighted total marks, and adds to a Series. 4. Demonstrates pandas Series attributes. 5. Solves problems from a textbook on Series. 6. Merges two DataFrames on a common column. 7. Creates charts like scatter, line, and bar from a DataFrame.

Uploaded by

Deepti Sharma
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 3

Practical Record Questions IP

_____________________________________________________________________
Program 1 :Create Series object temp1,temp2,temp3,temp4 to store the temperature of
days of week1,week2,week3,week4 respectively. Write a script to
a. Print the average temperature per week.
b. Print average temperature of the entire month.
Program 2:WAP that stores the sales of 5 fast moving items of a store for each month in
12 Series objects i.e. S1 Series object stores sales of these 5 items in 1st month,S2
stores sales of these 5 items in 2nd month and so on.
The program should display the summary sales report like this:

Total Yearly Sales, item-wise (should display stem of items’ sales over the months)

Maximum sales of item made: <name of item that was sold the maximum in whole year>

Maximum sales for individual items

Maximum sales of item 1 made: <month in which that item sold the maximum>

Maximum sales of item 2 made: <month in which that item sold the maximum>

Maximum sales of item 3 made: <month in which that item sold the maximum>

Maximum sales of item 4 made: <month in which that item sold the maximum>

Maximum sales of item 5 made: <month in which that item sold the maximum>

Program 3: Three Series objects store the marks of 10 students in three terms. Roll
numbers of students from the index of these Series objects. The Three Series objects
have the same indexes.
Calculate the total weighted marks obtained by students as per following formula:

Final marks = 25%. Term 1 + 25% Term 2 + 50% Term 3

Store the Final marks of students in another Series object.

Program 4: WAP showing use of attributes for 3 pandas Series objects.


(size,nbytes,empty,dtype,hasnas,index,values,etc)
Program 5: Question 9 ,10 from NCERT textbook, chapter 2 pg 61

Program 6 : Ques 11 from NCERT textbook, chapter 2 pg 61


Program 7: Create a DataFrame that contains names and marks in 3 subjects. WAP to
calculate the total marks obtained by each student in 3 subjects(Phy,Chem,Maths) and
create a column ‘Total ‘ in the dataframe.
Program 8: write a program for the previous program dataframe that calculate grade
consisting average marks obtained for each student.
Grades to be calculated according to marks:
Marks Grade
>=90 A+
70-90 A
60-70 B
50-60 C
40-50 D
<40 F
Program 9: Create a DataFrame with column labels and index labels of your choice and
having a minimum 4 rows in it. Print the result of following attributes:
(a) Index
(b) Columns
(c) Size
(d) Values
(e) Shape
(f) Axes
(g) Dtypes
(h) Empty
(i) T
Program 10:A dataframe Stu stores details like 'Name', 'Class', 'Subject_Id' for 10
students and another dataframe Marks stores details like 'Subject_Id' and 'Avgmarks'. Write
code so that two dataframes merge data on the basis of common Subject id.
Program 11: Given a data frame df1 as shown below:

1990 2000 2010


a 52 340 890
b 64 480 560
c 78 688 1102
d 94 766 889

Write code to create:


(a) A scatter chart from the 1990 and 2010 columns of dataframe df1
(b) A line chart from the 1990 and 2000 columns of dataframe df1
(c) Create a bar chart plotting the three columns of dataframe dfl

Program 12. The score of four teams in 5 IPL matches is available to you.
(a) Write a program to plot these in a bar chart .
(b) Create a pie chart showing the last match’s performance as a wedge
Program 13: Write a program to show the variations in prices for each
month by 3 lines on same line chart. Make sure to add legends and labels. Show
grid also.
Program 14: Navya has started an online business. A list stores the
number of orders in last 6 months. Write a program to plot this data on a
horizontal bar chart.
Program 15: Given the following set of data:
Weight measurements for 16 small orders of French-fries (in grams).
78 72 69 81 63 67 65 75
79 74 71 83 71 79 80 69
(a) Create a simple histogram from the above data
(b) Create a horizontal histogram from the above data
(c) Create a step type of histogram from the above data
(d) Create a cumulative histogram from the above data

__________________________________________________________________________

You might also like