Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Class 12 Holiday HW-2022-23

1) Solve CBSE QP 2021-22 (PDF enclosed)


2) Given a Series object Cricket as shown below:
A    7600
B    5600
C    7000
D    7000
E 6000
F 9000

Write the code for the below considering the updated Series every time:

a) Display the first two rows


b) Display the first three rows
c) Display the row B
d) Display the rows A and D
e) Delete the row D
f) Delete the rows A and C
g) Insert a row G 8000
h) Update the value of B as 5000
i) Update the value of F as 6000
j) Change the index of G to H
k) Display the size of the series
l) Display the number of rows in the series
m) Display the data frame in the descending order of values
n) Display the index, data type, values ,axis ,dimension, count of the above series
o) Display the rows whose value is more than 5000

Given another series Basketball as shown below:


A   20
B   30
C   10
F   40

Write the output of the below considering the original series:

p) Cricket *Basketball v) Basketball[0::2]


q) Cricket-Basketball w) Cricket[0:3:2]*100
r) Cricket+Basketball x) Basketball[1:3]-cricket[2:4]
s) Cricket/Basketball y) Cricket>500
t) Cricket[0:1] z) Basketball[Basketball>30]
u) Cricket[1:]
3) Given a data frame namely data as shown in adjacent table (fruit names are row labels).
Write code statement to: 

 Color    Count    Price


Apple    Red    3    120
Apple    Green    9    110
Pear    Red    25    125
Pear    Green    26    150
Lime    Green    99    70

a) Insert a new row Grapes Black 56 97.


b) Display all the rows.
c) List 2nd, 3rd and 4th rows.
d) List only rows 1, 3, 4 using iloc.
e) List only rows with labels 'Apple' and 'Pear' using loc.
f) List only columns 0 and 2 (column indexes) using iloc.
g) List only the columns Color and Price using loc.
h) Display the color and count column.
i) Find all rows with the label "Apple". Extract all columns.
j) Update the count of lime to 29.
k) Update the color of grapes to green without using loc and iloc.
l) Change the row index of lime to lemon and price to cost
m) Display the color and count of lime.
n) Display the price of lime using at.
o) Display the count of red apple using iat.
p) List the rows with count more than 25.
q) List single True or False to signify if all prices are more than 100 or not.
r) Display the data frame in the ascending order of their prices.
s) Display the three highest cost fruits.
t) Display the fruit name having highest count.
u) Display the number of rows.
v) Display the number of values in each column.
w) Display the number of values in each row.
x) Delete the row lime.
y) Delete the column price.
z) Delete the data frame.

You might also like