PDA_Assignment questions
PDA_Assignment questions
Instructions:
Given the list of values: [12, 34, 56, 78, 90, 23, 45, 67, 89, 101], perform the following tasks:
Assignment 2 :
You are tasked with building a dictionary-based data system for an educational institution. The institution
offers various courses, and students are enrolled in these courses. Your job is to create, manipulate, and
access various pieces of information using Python dictionaries.
Instructions:
• The dictionary will store data about students using their student ID as the key.
Each student will have a dictionary as the value, which contains their name, age, and a
list of courses they are enrolled in.
• Student 1: ID: 101, Name: "Aarav", Age: 20, Courses: ['AIML', 'Data
Structures']
• Student 2: ID: 102, Name: "Ishita", Age: 22, Courses: ['NHCE', 'Discrete Math',
'Algorithms']
• Student 3: ID: 103, Name: "Rahul", Age: 21, Courses: ['AI Ethics', 'New
Horizon', 'Databases']
7. Remove a course:
• Remove 'Discrete Math' from Ishita's list of courses, and delete the
corresponding grade entry.
8. Print all students and their data:
• Write a loop to print all student information in a readable format, including their
ID, name, age, courses, and grades.
Assignment 3:
Assignment-4
1. Write a Python program to create a Pandas DataFrame from a larger list of dictionaries containing
information such as name, age, score, and city. Perform basic operations like selecting specific columns
and filtering rows based on conditions.
2. Write a Python program to plot a line chart and a scatter plot using Matplotlib to visualize the age and
score data.
data_india = [
{'Name': 'Aarav', 'Age': 20, 'Score': 85, 'City': 'Mumbai'},
{'Name': 'Vivaan', 'Age': 21, 'Score': 90, 'City': 'Delhi'},
{'Name': 'Aditya', 'Age': 19, 'Score': 95, 'City': 'Bengaluru'},
{'Name': 'Vihaan', 'Age': 18, 'Score': 80, 'City': 'Chennai'},
{'Name': 'Reyansh', 'Age': 22, 'Score': 88, 'City': 'Hyderabad'},
{'Name': 'Krishna', 'Age': 23, 'Score': 93, 'City': 'Ahmedabad'},
{'Name': 'Shivansh', 'Age': 24, 'Score': 78, 'City': 'Kolkata'},
{'Name': 'Ayaan', 'Age': 25, 'Score': 85, 'City': 'Pune'},
{'Name': 'Kabir', 'Age': 21, 'Score': 91, 'City': 'Jaipur'},
{'Name': 'Arjun', 'Age': 20, 'Score': 87, 'City': 'Lucknow'},
]
Assignment 5: Handling Missing Data and Understanding Variability Using NumPy and Pandas
You are given a dataset that represents the ages of participants in a survey. However, some data points are
missing. Your task is to handle the missing data, then calculate the mean, variance, and standard
deviation to understand how much the ages differ from the average age.
Instructions:
ages = [23, 29, np.nan, 35, 22, 26, np.nan, 30, 32, 34]