1. Model Practical Examination 2024-25 Python Pandas QP
1. Model Practical Examination 2024-25 Python Pandas QP
a. Create a series with Name as index and Mark as value from the given data set.
b. Display the records of those students who have scored marks greater than 85.
c. Display the records of those student who have scored marks less than or equal
to 80.
d. Increase the mark by 10 whose name is “Renu”.
2 Create a series to store the amount of sales made by a salesperson for the last year
(whole months).
a. Display the sales amount which is greater than 10000.
b. Display the sales amount in the first four months.
c. Display the sales amount in the last four months.
3 Consider a Series object that stores the charity contribution (in Rs) of each section of a
school as shown below:
XII A 6000
XII B 7800
XII C 6540
XII D 7890
XII E 6890
XII F 7000
5 DataFrame is already created here. You have to write the code for the questions
mentioned below.
import pandas as pd
data = {'name': ['James', 'Anna', 'Janet', 'Yogi', 'Robin', 'Amal', 'Mohan'],
'city': ['Mexico City', 'Toronto', 'Prague', 'Shanghai','Manchester', 'Cairo
', 'Osaka'], 'age': [41, 28, 33, 34, 38, 31, 37],'score': [88.0, 79.0, 81.0,
80.0, 68.0, 61.0, 84.0]}
row_labels = [101, 102, 103, 104, 105, 106, 107]
df = pd.DataFrame(data=data, index=row_labels)
print(df)
6 Create a data frame using a dictionary with the given data and index:
'2020':[256,452,635,965],
'2021':[745,785,478,547],
'2022':[452,474,725,854],
'2023':[1021,958,528,425]
Index is ['Qtr1','Qtr2','Qtr3','Qtr4']
i=[101,102,103,104]
s={'Employee name':['Amra','Ann','Elsa','Rajeesh'],
'Department':['HR','Intern','Manager','CEO'],
'Salary':[35000,12000,89000,100000]}