Ip Practical File Class 12 - B Jyoti
Ip Practical File Class 12 - B Jyoti
PROGRAM 2
Q2. Object1 Population stores the details of Population in four metro cities of
India and Object2 AvgIncome stores the total average income reported in
previous year in each of these metros. Calculate income per capita for each of
these metro cities .
Output:-
PROGRAM 1
Q1. Consider the two series Objects11 and s12 that you created in example 11
and 12 respectively .Print the attributes of both these objects in a report form as
shown below .
PROGRAM 3
Q3. Create the following Series and do the specified operations:
(a)EngAlph , having 26 elements with the alphabets as values and default the
index values.
(b)Vowels, having 5 elements with the index labels 'a','e','i','o' and 'u' and all the
five values set to zero . Check if it is an empty series.
(c) Friends , from a dictionary having roll numbers of five of your friends as data
and their first name as keys.
(d) MTseries, an empty Series .Check if it is an empty series.
(e)MonthDays, from a numpy array havingthe numbers of days in the 12 months
of a year .The labels should be the month numbers from 1 to 12
(a)
(c)
(d)
True
PROGRAM 4
Q4. Using the Series created in Question 3 , write commands for the following Set
all the values of vowels to 10 and display the Series
(a) Divide all values of vowels by 2 and display the Series
(b) Create another series vowels1 having 5 elements with index labels
'a','e','i','o' and 'u' having values [2,5,6,3,8] respectively
(c) Add vowels and vowels1 and assign the result to vowels3
(d) Subtract, Multiply and Divide vowels by vowels1
(e) Alter the labels of vowels to ['A','E','I','O','U']
(a)
(b)
(d)
(e)
(II)
(III)
PROGRAM 5
Q5. Using the Series created 3 , write commands for the following:
(a)Find the dimensions, size and values of the Series EngAlph , Vowels , Friends ,
MTSeries , MonthDays
(b) Rename the Series MTSeries as SeriesEmpty
(c) Name the index of the Series MonthDays as monthno and that of Series
Friends as Fname
(d) Display the 3rd and 2nd value of the Series Friends,in that order
e) Display the alphabets 'e' to 'p' from the Series EngAlph
(f) Display the first 10 values in the Series EngAlph
(g) Display the last 10 values in the Series
(h) Display the MTSeries
(a)
(d)
(g). (h)
PROGRAM 6
Q6. Create the following DataFrame Sales conatining year wise sales figures for
five salespersons in the INR. Use the years as the column labels, and salesperson
names as row labels.
PROGRAM 7
Q7. Use the DataFrame created in Question 6 abouve to do the following :
(a) Display the rows labels of Sales
(b) Display the column labels of Sales
(c) Display the data types of each column of Sales
(d) Display the dimensions , shape, size and values of Sales
(e) Display the last two rows of Sales
(f) Display the first two columns of Sales
(g) Create a dictionary using the following data. Use this dictionary to create a
DataFrame Sales2
(h) Check if the Sales2 is empty or it contains data
(a)
(b)
(e). (f)
(g) (h)
PROGRAM 10
Q10. 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
objecrs have the same indexes .
Calculate the total weighted marks obtained by students as per following
formula.
Final marks =25% Term1 + 25%. Term 2 + 50%. Term 3
Store the final marks of students in another Series object
PROGRAM 9
Q9 Write a program that stores the sales of 5 fast moving items of a store for
each month in 12 Series obejects,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:
PROGRAM 8
Q8. Use the DataFrame created in Questions 6 and 7 to do the following
(a) Append the DataFrame Sales2 to the DataFrame Sales
(b) Change the DataFrame Sales such that it becomes it’s transpose
(c) Display the sales made by all salespersons in the year 2017
(d) Display the sales made by Madhu and Ankit in the years 2017 and 2018
(e) Display the sales made by Shruti in 2016
(f) Add data to Sales for salesman Sumeet where the sales made are
[196.5,37800,52000,78438,38852]in the years[2014,2015,2016,2017,2018]
respectively
(g) Delete the data for the year 2014 from the DataFrame Sales
(h) Delete the data for salesman Kinshuk form the DataFrame Sales
(i) Change the name of the salesperson Ankit to Vivaan and Madhu to Shailesh
(j) Update the sales made by Shailesh in 2018 to 100000
(a)
(c) (II)
(II)
(e)
(f)
(g).
(J)
INFORMATION PRACTICES
Practical File
Name- Jyoti
Class – 12-B
Roll no.- 15
Operations.
4. Using the Series created in Question 3, write commands. 6 to 8
For the following:
5. Using the Series created in Question 3, write commands. 9 to 11
For the following