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

Seriespractical

The document describes 10 pandas series practical exercises: 1. Create a series from a dictionary. 2. Create a series from a tiled numpy array. 3. Change values at specific indices in a series. 4. Calculate the cubes of values in a series. 5. Sort a series in ascending and descending order. 6. Print attributes like data type and shape of a series. 7. Calculate ticket sales amounts from student counts in sections of a series. 8. Calculate total student counts from two series of school enrollment data. 9. Find the largest and smallest three values from a series of state areas. 10. Filter a series to values above a threshold.

Uploaded by

anvisharma343
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)
86 views2 pages

Seriespractical

The document describes 10 pandas series practical exercises: 1. Create a series from a dictionary. 2. Create a series from a tiled numpy array. 3. Change values at specific indices in a series. 4. Calculate the cubes of values in a series. 5. Sort a series in ascending and descending order. 6. Print attributes like data type and shape of a series. 7. Calculate ticket sales amounts from student counts in sections of a series. 8. Calculate total student counts from two series of school enrollment data. 9. Find the largest and smallest three values from a series of state areas. 10. Filter a series to values above a threshold.

Uploaded by

anvisharma343
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

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