0% found this document useful (0 votes)
18 views2 pages

Xii - Ip - Holiday HW

The document provides a list of 15 pandas programming exercises involving Series and DataFrames. The exercises include creating Series and DataFrames from various data, manipulating indexes, sorting values, selecting specific rows and columns, and iterating through DataFrames.
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)
18 views2 pages

Xii - Ip - Holiday HW

The document provides a list of 15 pandas programming exercises involving Series and DataFrames. The exercises include creating Series and DataFrames from various data, manipulating indexes, sorting values, selecting specific rows and columns, and iterating through DataFrames.
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/ 2

CLASS XII

INFORMATICS PRACTICES
HOLIDAY HOMEWORK (2024-25)
Write the following pandas(Series & Dataframe) programs in the practical file:
Practical List:
1. Create a pandas series from a dictionary of values and ndarray.
2. Given a Series, print all the element that are above the 75th percentile.
3. Create a Data Frame quarterly sales where each row contains the item category, item
name and expenditure. Group the rows by the category and print the total expenditure
per category.
4. Create a Data Frame for examination result and display row labels, column labels,
datatypes of each column and the dimensions.
5. Given a series that stores the area of some states in km 2. Write code to find out the
biggest and smallest three areas from the given series. Series elements are given below:
Ser1=([34567, 890, 450, 67892, 34677, 78902, 256711, 678291, 637632, 25723,
2367, 11789, 345, 256517])
6. Write a program to create a Series object with 6 random integers and having indexes
as: [‘p’, ‘q’, ‘r’, ‘n’, ‘t’, ‘v’].
7. Write a program to create data series and then change the indexes of the Series object
in any random order.
8. Write a program to sort the values of a Series object s1[6700,5600,5000,5200] in
ascending order of its values and store it into series object s2.
9. Given a Series s4[7600,6500,4000,2500]. Write a program to change the values at its
2nd row (index1) and 3rd row to 8000.
10.Four dictionaries store the details of four employees of the month as (empno, name).
Write a program to create a Data Frame from these.
11.Given a Data Frame df:
AGE NAME WEIGHT
0 15 Arnav 42
1 22 Charles 75
2 35 Guru 66
Write a program to display only the weight of first and third rows
12.Write a program to display number of rows and columns in Data Frame df (created in
previous question) without using shape attribute.
13. Create the Data Frame “Sales” given below and do the following queries(a to g):
2014 2015 2016 2017
Madhu 100.5 12000 20000 50000
Kusum 150.8 18000 50000 60000
Kinshuk 200.9 22000 70000 70000
Ankit 30000 30000 100000 80000
Shruti 40000 45000 125000 90000
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 or Sales.
g. Display the transpose of Sales Data Frame.
14. Using iteritems() write a program to extract data from the Data Frame ( created above
in question 12) column wise.
15. Using iterrows() write a program to print the Data Frame( created above in question
12) one row at a time.

You might also like