Question bank_ Python cia 3
Question bank_ Python cia 3
QUESTION BANK
PART A
Define NumPy arrays and explain their primary advantage over Python lists.
How do missing data values affect data analysis, and how can they be handled in Pandas?
Develop the python code to read data from a CSV file into a Pandas DataFrame.
Infer the method that you use to fill missing values in a Pandas Series.
Construct a pivot table using Pandas from a Data Frame containing columns Product, Region,
and Sales.
Given a NumPy array arr = [5, 10, 15, 20, 25], write a code snippet to compute the cumulative
sum.
Write a Python code snippet to create a NumPy array of shape (3, 3) containing random
integers between 1 and 10
Demonstrate how to perform an inner join operation on two Pandas Data Frames.
PART B
Demonstrate with examples how NumPy arrays differ from Python lists in terms of
performance, functionality, and memory usage.
Discover the concept of universal functions (ufuncs) in Python with a detailed example.
Discuss the advantages of ufuncs in data processing tasks.
Enumerate the concept of NumPy slicing and indexing. Provide a detailed example to
illustrate how slicing is used to extract and modify specific elements of an array.
Filter and display employees who are in the "HR" department and have a Performance_Score
greater than 90.
Illustrate the different methods of handling missing data in Pandas, such as filling and
dropping. Discuss the implications of each method with examples.
Illustrate the importance of handling missing values in a Pandas Series. Explain various
methods for dealing with missing data in Series with a scenario-based example.
Analyze the use of pivot tables in Pandas for summarizing data. Provide an example of
creating a pivot table for sales data and interpreting the results.
You have been provided with data showing population growth in five countries over the past
20 years. The data includes columns for "Year," "Country," and "Population."
1) Develop a Python program to visualize the population growth for each country using
Matplotlib.
2) Use a line plot to show trends for each country over the years, differentiating each
with a unique color and line style.
3) Create an area plot below the line plot to show the cumulative population across all
countries for each year
Add titles, legends, and labels to enhance readability, and adjust the layout for a clean
appearance.