You are on page 1of 2

PANDAS-SERIES PRACTICALS

1. WAP to create series object from dictionary.( Take dictionary key-values pair of your choice).
2. WAP to create series object using an ndarray that is created by tiling a list [4, 6, 8], twice.
3. Given a series object s1. WAP to change the value at its 2nd row(index1) and 3rd row to 8000
s1: 1 6700
2 5600
3 5000
4 5200
4. Given a series object s2. WAP to calculate the cubes of the series values.
s2: 0 5
1 7
2 9
5. WAP to sort the values of a series object s3 in ascending and descending order of its values.
s3: Jan 31
Feb 28
Mar 31
Apr 30
6. Consider the above series of practical 5 i.e. s3 and WAP to print following attributes of the
series object:
 Data type
 Shape
 No. of bytes
 No. of dimension
 Has NaNs?
7. Consider a series object s4 that stores the number of students in each section of class 12 as:
s4: A 39
B 41
C 42
D 44
Section B and D have been given a task of selling tickets @100/- per ticket as a part of social
experiment. Write code to display how much they have collected.
8. Number of students in class 11 and class 12 in three streams (‘Science’,’Commerce’,
’Humanities’) are store in two series objects c11 and c12. Write code to find total number of
students in class 11 and class 12.
9. Given a series that stores the area of some states in km2. Write a code to find out the largest
and smallest three areas from the given series. The given series has been created like this:
s5=pd.Series([34567, 890, 450, 67892, 34677, 78902, 256711, 678291, 637632, 25723, 2367,
11789, 345, 256517])
10. From the above given series s5 that stores the area of states in km2. Find out the areas that
are more than 50000km2.

You might also like