0% found this document useful (0 votes)
106 views

Ip Practical File Class 12 - B Jyoti

This document contains 10 programming questions related to pandas in Python. The questions cover topics like creating and manipulating Series and DataFrame objects, performing calculations on data, appending and transposing DataFrames, and generating reports from data. The questions get progressively more complex, involving operations like adding, subtracting, multiplying and dividing Series, appending DataFrames, selecting and updating data. The goal is to demonstrate proficiency in pandas for tasks like data cleaning, manipulation, analysis and reporting.

Uploaded by

Mahi Srivastava
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
106 views

Ip Practical File Class 12 - B Jyoti

This document contains 10 programming questions related to pandas in Python. The questions cover topics like creating and manipulating Series and DataFrame objects, performing calculations on data, appending and transposing DataFrames, and generating reports from data. The questions get progressively more complex, involving operations like adding, subtracting, multiplying and dividing Series, appending DataFrames, selecting and updating data. The goal is to demonstrate proficiency in pandas for tasks like data cleaning, manipulation, analysis and reporting.

Uploaded by

Mahi Srivastava
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 25

Mpvm ganga gurukulam

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:-

[Information practices ]. -Jyoti


Mpvm ganga gurukulam

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 .

[Information practices ]. -Jyoti


Mpvm ganga gurukulam

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)

[Information practices ]. -Jyoti


(b)

(c)

(d)

True

[Information practices ]. -Jyoti


e)

[Information practices ]. -Jyoti


Mpvm ganga gurukulam

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)

[Information practices ]. -Jyoti


(c)

(d)

(e)

[Information practices ]. -Jyoti


(I)

(II)

(III)

[Information practices ]. -Jyoti


Mpvm ganga gurukulam

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)

[Information practices ]. -Jyoti


(b) (c)

(d)

[Information practices ]. -Jyoti


(e). (f)

(g). (h)

[Information practices ]. -Jyoti


Mpvm ganga gurukulam

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.

[Information practices ]. -Jyoti


Mpvm ganga gurukulam

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)

[Information practices ]. -Jyoti


(c). (d)

(e). (f)

(g) (h)

[Information practices ]. -Jyoti


Mpvm ganga gurukulam

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

[Information practices ]. -Jyoti


Mpvm ganga gurukulam

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:

[Information practices ]. -Jyoti


[Information practices ]. -Jyoti
Mpvm ganga gurukulam

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)

[Information practices ]. -Jyoti


(b)

2018. 160000.0 110000.0 500000.0 340000.0. 900000.0

(c) (II)

[Information practices ]. -Jyoti


(d)

(II)

(e)

[Information practices ]. -Jyoti


(II)

(f)

Sumeet. 196.2. 37800 .0 52000. 0 78438. 0 38852.0

(g).

Sumeet 37800. 52000. 78438. 38852

[Information practices ]. -Jyoti


(h)

Sumeet. 37800. 52000. 78438. 38852


(I)

Sumeet. 37800. 52000. 78438. 48852

(J)

Sumeet. 37800. 52000. 78438. 38852

[Information practices ]. -Jyoti


M.P.V.M
GAnGA gurukulam

INFORMATION PRACTICES

Practical File

Name- Jyoti
Class – 12-B
Roll no.- 15

[Information practices ]. -Jyoti


Index
SNO. PROGRAM. PAGE NO. REMARK
.1 Consider the two series Objects11 and s12 that you. 1
Created in example 11 and 12 respectively.Print the.

Attributes of both these objects in a report form as


Shown below
2 object1 Population stores the details of Population in. 2
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
Per capita for each of these metro cities.
3. Create the following Series and do the specified. 3 to 5

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

6. Create the following DataFrame Sales conatining year wise. 12


Sales figures for salespersons in INR . Use the years as
Column labels, and salesperson names as row labels

[Information practices ]. -Jyoti


7. Use the DataFrame created in Question 6 above to do the. 13 to 14
Following
.8. Use the DataFrame created in Question 6, 7 to do following. 15 to 19

.9. Write a program that stores the sales of 5 fast moving 20 to 22


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

10. Three Series objects store the marks of 10 students in. 23


Three terms. Roll numbers of students from the index of
these Series objects . the three Series objects have the same
Indexes

[Information practices ]. -Jyoti

You might also like