PPPL Final Practical Questions
PPPL Final Practical Questions
Q1. Plot the distribution of total bill amounts using seaborn and matplotlib.
Q2. Create a scatter plot showing the relationship between total_bill and tip. Use
hue based on time.
2. Dataset: iris
Q6. Draw a scatter plot showing the distribution of petal_length for each species.
Q7. Create a heatmap of the correlation matrix for the iris dataset.
3. Dataset: flights
Q8. Create a line plot showing the number of passengers over years.
Q9. Make a heatmap showing monthly passenger numbers for each year (pivot
table).
Q10. Plot a barplot showing the average number of passengers per month.
4. Dataset: diamonds
Q11. Plot the relationship between carat and price. Use color to differentiate by
cut.
6. Dataset: penguins
Q2. Plot the regression line along with the data points.
2. Multivariate House Price Prediction
Q2. Which feature has the strongest impact on house price? (Check using model
coefficients.)
3. Insurance Premium Prediction
Q3. Calculate the mean absolute error (MAE) for your model.
(Dataset: Social_Network_Ads.csv)
4. Predicting Purchase Behavior
Q9. Build a logistic regression model to predict if a user purchases a product
(Purchased) based on Age and EstimatedSalary.
Q10. Evaluate the model using a confusion matrix and accuracy score.
Q11. Plot the confusion matrix for your logistic regression model.
Q14. Use train-test split (e.g., 75%-25%). What is the best k value (try k = 3, 5,
7)?
Q15. Plot a confusion matrix and find model accuracy for each k.
G. Subtract the start time from the end time to calculate how long the function
took to execute.
H. Print or log the name of the function being executed.
I. Print or log the execution time in seconds or milliseconds.
J. Explain abstraction with suitable example.
K. Explain Polymorphism with suitable example.
L. Create a base class Student that will store basic student information (e.g.,
name, ID, grade, etc.).
M. Implement methods to set and get the student’s attributes.
N. Handle basic validation for input data (e.g., name should be a string, grade
should be numeric, etc.).
O. Implement error handling to catch invalid inputs (e.g., if a name is not a string,
if grade is out of range, etc.).
P. Use try and except blocks to catch exceptions and display meaningful error
messages to the user.
Q. Create a subclass AdvancedStudent that inherits from Student and adds more
features (e.g., handling advanced subjects, extra credits, or GPA calculation).
22. Test error handling by providing invalid data (e.g., entering a negative grade,
non-string names).
23. Create a 1D and 2D NumPy array and determine their shape, size, and data
type.
24. Convert a Python list into a NumPy array and check its properties such as
shape and data type.
25. Generate a NumPy array from a list and explore its dimensions, total
elements, and type.
26. Create and analyze NumPy arrays by checking their structure, size, and
underlying data type.
27. Create a Pandas Series and a DataFrame from a Python list, dictionary, and
NumPy array, ensuring proper column names.
28. Load a CSV file into a Pandas DataFrame, display the first 10 rows, and check
its structure, including the number of rows and columns