Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Name - ________________

Class - ________________

Subject - _______________

Roll No - ________________

SUBMITTED BY -
___________________
SUBMITTED TO -
___________________
Question1: Write code to create a
series object using the python
sequence [4,6,8]. Accept that
pandas is imported as alias name
pd.
Solution:
Question2: Write code to create a
series object using an ndarray that
is created by tiling a list [3,4],
thrice. Accept that pandas is
imported as alias name pd.
Solution:
Question3: Consider the two series
s1 and s2 that you created in
previous slides. Print the attributes
of both these objects in a report
form as shown below. Accept
that pandas is imported as alias
name pd.
Question4: Consider the series
object s4 that stores the number
of students in each section of
class 12. For two sections have
been given a task of selling tickets
@100/- per ticket. Write the code
to display how much they have
collected. Accept that pandas is
imported as alias name pd.
Question5: Consider the series
object s5 that stores the
contribution of each section, as
shown below. Write the code to
modify the amount of section ‘A’
as 7600 and for sections ‘C’ and
‘D’ as 7000. Print the changed
object. Accept that pandas is
imported as alias name pd.
Solution:
Question6: Number of students in
classes 11 and 12 in three streams
(Science, Commerce and
humanities) are stored in two
series objects c11 and c12. Write
code to find total number of
students in class 11 and 12, stream
wise. Accept that pandas is
imported as alias name pd.
Solution:
Question7: Write a program to sort
the values of a series object s7 in
ascending order of its values and
store it into series object soln.
Accept that pandas is imported
as alias name pd.
Solution:
Question8: Given a series that
stores the area of some states in
km^2. Write a program to find out
the biggest and smallest three
areas from given series. Accept
that pandas is imported as alias
name pd. Given the series has
been created like this:
S8=pd.Series([34567, 890, 450, 67892, 34677,
256711, 256518])
Solution:
Question9: Write a
program to create a
Data frame from a 2d list.
Specify own index labels.
Accept that pandas is
imported as alias name
pd .

Solution:
Question10: Write a program to create
a Data frame from a list containing 2
lists, each containing target and
Actual sales figures of four zonal
offices. Give appropriate row labels.
Accept that pandas is imported as
alias name pd.
Solution:
Question11: Write a program to
create a Data frame to store
weight, age and names of 3
people. Print the Data frame and its
transpose. Accept that pandas is
imported as alias name pd.
Solution:

You might also like