0% found this document useful (0 votes)
44 views3 pages

Practical File Questions (2023-24)

Uploaded by

Chhavi Bansal
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)
44 views3 pages

Practical File Questions (2023-24)

Uploaded by

Chhavi Bansal
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/ 3

Practical File Questions(2023-24)

1 Write a code to create a series object using the Python sequence [4, 6, 8,
10]. Assume that pandas is imported as alias name pd.

2 Write a program to create a Series object using a dictionary that stores


the number of students in each section of class 12 in your school?

3 Create two series S1 and S2 (the way done in Q1). Perform


various mathematical operations (+, - , *, /) on both the series.

4 Consider the series object S that stores the contribution of each section,
as shown below:
A 4300
B 6500
C 3900
D 6100

Write code to modify the amount of section ‘A’ as 3400 and for section
‘C’ and ‘D’ as 5000. Print the changed object.

5 Give an a list namely area that stores the area of some state in km.
Area=[34567,890,450,780,990,100,1299]
Write python code to perform the following operations :
(1)Create a series object namely Ser1 using the list area given below .
(2) Print the largest three areas from the series Ser1 .
(3)Print the smallest three areas from the series Ser1.

6 Consider a series objects vls,w write statements to do the following:-


vls=pd.Series([11,23,31,61,87,93,index=[‘a’,’b’,’c’,’d’,’e’,’f’])
Base on this series object, write statements to do the following:-
a. Retrieve and third elements and print it.
b. Retrieve and print the first three elements.
c. Retrieve and print the last two elements.
d. Retrieve and print the alternate elements starting from index ‘b’.

7 Write a program to create a DataFrame to store Roll Number, Name


and Marks of five students. Print the DataFrame and its transpose.

8 Write a program to create a Data Frame Quarterly Sales where each row
contains the Quarterly Sales of TV, Freeze and AC. Show the DataFrame
after deleting details of Freeze.

9 Create two dataframes df1 and df2. Perform various


mathematical operations (+, - , *, /) on both the dataframes.

10 Write a program to create the dataframe display a menu to show the


following information regarding the dataframe.

Transpose, Column names, indexes, datatypes of


individual columns, size and shape of the dataframe. Your
program must keep on displaying as per the menu till the user’s
choice.

11 Write a program to create a menu driven program to display various


sets of records from the dataframe depending upon the choice of the
user. ( Consider the dataframe named DATA)
1. display the first five rows
2. display the last five rows
3. Display any number of records from the top
4. Display any number of records from the bottom
12 Write a program to create a DataFrame from a CSV file. Display the
shape (Number of rows and columns) of the CSV file.

13 Write a program to create a DataFrame which contains RollNumber,


Name, Height and Weight of 05 students. Create a CSV file using this
DataFrame.

14

Create the above data frame with index value [10,20,30,40,50]

15
Consider the given dataframe and answer the following questions:

i. Write a program to create the dataframe “Student”.


ii. Write command to display the names and section of all students.
iii. Write command to display the details of the students in the
reverse order of their indexes.
iv. Write command to display the first 4 records
v. Write command to display all odd number records.
vi. Write command to display the last 3 records.

You might also like