You are on page 1of 15

NAME :- RISHITA RAM MAURYA

CLASS:- XII-COMM
ROLL NO :- 25
SUBJECT :- IP
PRACTICAL EXAM TERM - I
Q1. Write Python code to create a Series object Temp1 that
stores temperatures of seven days in it. Take any random
seven temperatures.
Q2. Write Python code to create a Series object Temp2 storing
temperatures of seven days of the week. Its index should be
‘Sunday'.
Monday'. ‘Saturday’.
Q3- A series object (say T1) stores the average
temperature recorded on
each day of a month. Write code to display the
temperatures recorded on:
(i) First 7 days
(ii) Last 7 days
Q4.Series objects Temp1, Temp2, Temp3, Temp4 store the
temperatures of days of week1, week2, week3, weeken4
respectively. Write a script to create this

Q5. 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
the following
formula:
Final marks = 25%. Term 1 + 25% Term 2 + 50% Term 3
Store the Final marks of students in another Series object.
Q6. Write code to print all the information about a Series
object.
Q7. Write a program to create three different Series objects
from the three columns of a DataFrame df.

Q8- Write a program to create three different Series objects


from the three rows of a DataFrame df.
Q9-Write a program to create a Series object from an array that
stores characters from ‘a’ to ‘g’.

Q10-Write a program to create a Dataframe storing salesmen


details (name, zone, sales) of five salesmen.
Q11. Four dictionaries store the details of four
employees-of-the-month
as (empno, name). Write a program to create a data frame
from these.

Q12. A list stores three dictionaries each storing details, (old


price, new price, change). Write a program to create a
dataframe from it.
Q13. 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.

Q14-Use the DataFrame created in Question 13 above to do the


following:
a) Display the row 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 Sales2 is empty or it contains data

Q15. Use the DataFrame created in Question 13 above to do the


following:
a) Append the DataFrame Sales2 to the DataFrame Sales.
b)Change the DataFrame Sales such that it becomes its
transpose

c) Display the sales made by all salespersons in the year


2017

d)Display the sales made by Madhu and Ankit in the year


2017 and 2018

e) Display the sales made by Shruti in 2016.


f) Delete the data for the year 2014 from the DataFrame
Sales.

g)Delete the data for salesman Kinshuk from the


DataFrame Sales.

h)Change the name of the salesperson Ankit to Vivaan and


Madhu to Shailesh.

i) Update the sale made by Shailesh in 2018 to 100000.


j)Write the values of DataFrame Sales to a comma
separated file SalesFigures.csv on the disk. Do not write
the row labels and column labels.

k) Read the data in the file SalesFigures.csv into a


DataFrame SalesRetrieved and Display it. Now update the
row labels and column labels of SalesRetrieved to be the
same as that of Sales.

You might also like