You are on page 1of 4

11Page

ASSIGNMENT SERIES 29.04.2022

1. Create a Series object with no parameter.

2. Create a non-empty Series objects with the following


a. A Python sequence
b. An ndartav
C. A scalar value
d. A Python dictionary
e. A mathematical expression

3. Consider the two series objects S11 and S12 respectively. Print the
attributes of both these objects in a report form.
$11-12.75,12.50,22.25,32.00,41.75]
S12=[24.5,22.5,45.0,37.8,34.5,10.0]
4. Extract Slices from Series Object:
ODja=data : 28,31,31 index=Feb,Mar,Jan
Obj6=data : 11,14,14,20,25 index=default index
Obj7 =data 18,20,22,24 index=9,10,11,12

5. Consider a Series object 'bookfair' that stores the number of students in


each section ofclass 12 as shown below:
39
B 41
C 44
D 40

The last tvo sections have been given a task of


selling tickets @ 200/-per
ticket as part of social activity. Write a code to display how much they have
collected
6. Consider the Series object 'Charity' that stores the contribution of each
section, as given beiow
A 6700
5500
C 5000
D 5200
21Page
write code to modify the amount of section 'A' as 7600 and for sections 'C

and 'D'. Print the


changed object.
. Assume a series object 'transdata' consists of around 2500 rows of data.

Write a program to print the following details:

a. First 100 rows of data b. Last 5 rows of data.

8. With
example programs, explain the vector operation on Series object.

9. Give the output of the following program


import pa ndas as pd
S=pd.Series((10,20,30,40,50,60,70,80] index=['a',b',,C,d','e','F,g','h')
print(s[2:5])
print(1:7:2])
print(s 2
prin(s[2:
10. Fill the missing statement to print value of 1st element using index label
value.
import pandas as pd
S-pd.Series( [1,2,3,4,5],index=['a',b',C,'d',e'])
#retieve a single element

Its output is as foilows

11. Write a program to delete a 1st element from the above series.

12.Write code to show rows those empno are greater than 103.

13.Write the missing line to delete the index no from 1 to 3 using slicing.

14. Show the first 3 values from Series using iloc.

15.Give the difierence between loc and


iloc.(with prog)
** * * ****** ***
31Page

Consider the ASSIGNMENT- MysQL 29.04.2022


following table:
Admn Name
Gender Stream
1001 Shrishti F Optional Average
Science CS 90.50
1002 AThe
Humanities Maths 80.45
1003 Adithya V
Commerce IP 60.23
1004 Ranu
Science IP 65.45
1005 Sonai
Commerce Maths 60.00
1006 Saranya
Science P 65.00

1 Create table student with the


given attributes
2 Add te tupies.
3. Display al! the iiformation from student table.
4 To disp ay the details of all those students who have IP
their
as optional
subject
5. To dis play name, stream and optional of all those students whose name
arts ith "A",

6 To give increase of 3 in the average of all those students of humanities

section who have Maths as their optional subject.


o d'so'ava rarne list of all those students who has
average more than

8 To disp'ay cha highest 2nd lowest average of Science stream students.


9 To disp lay the name and optional of CS and IP.

10. To disrlay the last two characters of admission name along with

student name.

11. To disp'ay optional subject available. Duplicate values should not be

iisplayed
4 Page

12. To sort the


records in the
13.To
alphabetical order of names.
display the number of
students having
average above 62.
IP as
optional and forr tho
tho

14.To display names of those students


who do not
5.To dis
play the names of female belong to "CS.
students who has exactly four
in their names. characters
16. To
display the details of those
students, whose optional
assigned. subject is not
7. To
display the neme and
average of those students
not in the
range of 67 to 75. whose average is
18. To
display the details of the
student, having name as
belonging to the stream 'Saranya' and
9.To c'selay 'Science'.
the
length of each student
name
20.Torund off the along with their names.
average.

**** *** k
* **

You might also like