0% found this document useful (0 votes)
1 views9 pages

Python QB

Python for data science question bank

Uploaded by

iswarya mecse
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views9 pages

Python QB

Python for data science question bank

Uploaded by

iswarya mecse
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd

Format ACD-

[Link]’S COLLEGE OF ENGINEERING ANDTECHNOLOGY


No. CF-QB
Elupatti, Thanjavur – 613 403
Issue No. 01
QUESTION BANK Rev. No. 00

Academic Year: 2025-2026 / EVEN


Dept / Year / Semester: AI & DS / I/ II - B
Subject Code &Name: AD25201 & PYTHON FOR DATA SCIENCE
Ring(R) – Level 1, Uing (U) – Level 2, Aping (Ap) – Level 3, Analyzing (Az) – Level 4, Evaluating
(E) – Level 5, C (C) – Level 6.
UNIT I Basics of Python:
What is Python, Python Interpreter, Python language basics: Language Semantics, Data Types, Variables,
Basic Functions, Operators, Flow Control Statements, Data Structures and Sequences: List, Tuple, Set,
Dictionaries.
PART– B
Learning
[Link] Questions COs
Level
1. What is python? C116.1 R
2. What is a python interpreter? C116.1 R
3. What are the key features of python? C116.1 R
4. What are the key features of python? C116.1 R
5. List any four built-in data type in python. C116.1 U
6. What is a variable in python? C116.1 R
7. How are variables declared in python? C116.1 U
8. What is type conversion? C116.1 R
9. Name any two basic functions in python. C116.1 U
10. What are operators in python? C116.1 R
11. What are arithmetic operators in python? C116.1 R
12. What is the purpose of the if statement? C116.1 U
13. What is a loop in python? C116.1 U
14. What is the difference between break and continue? C116.1 U
15. What is a list in python? C116.1 R
16. What is a tuple in python? C116.1 U
17. What is a set in python? C116.1 U
18. What is a dictionary in python? C116.1 R
19. How is a comment written in python? C116.1 U
20. What does the len() function do? C116.1 U
PART–C
1. Describe the role of the python interpreter in program execution with an C116.1 U
example.
Explain python’s language semantics with example of indentation, keyword and
2. C116.1 U
naming conventions.
3. Discuss python data types in detail with example for each type. C116.1 U
4. Explain variables and type casting in python with suitable examples. C116.1 U
Write short notes on the following basic functions:
5. C116.1 U
print(),input(),len(),type(),and range().
6. Explain in detail the different types of operators in python with examples. C116.1 U
Describe flow control statements in python with example for if, elif, else, and
7. C116.1 U
looping constructs.
8. Explain the working of for and while loops in python with examples. C116.1 U
Write a python program to display all even numbers between 1 and 100 using a
9. C116.1 U
loop. Explain the logic.
10. Discuss the various data structures available in python and their key features. C116.1 U
UNIT II Functions and Files
Defining a Function, Passing Arguments, Return Values, Passing a List, Creating and Using a Class, Strings:
Working with Strings, String Methods, Files: Reading from a File, Writing to a File, Exceptions, Python
Libraries: Importing libraries.
PART– B
1. What is a function in python? C116.2 R
2. How do you define a function in python? C116.2 U
3. What is the use of the return statement? C116.2 R
4. What are positional arguments? C116.2 R
5. What are keyword arguments? C116.2 R
6. What is the difference between parameters and arguments? C116.2 U
7. What does none signify in python? C116.2 U
8. How do you pass a list to a function? C116.2 U
9. What is a class in python? C116.2 R
10. How do you C an object of a class? C116.2 U

11. What is the purpose of the init() method? C116.2 U

12. What is self in python class? C116.2 R

13. What are string methods? C116.2 U

14. How do you read data from a file in python? C116.2 U

15. How do you write data from to a file in python? C116.2 U

16. What is the difference between ‘w’ and ‘a’ mode? C116.2 U
17. What is an exception in python? C116.2 R

18. Write syntax for exception handling C116.2 U

19. What is a python library? C116.2 R

20. How do you import a library in python? C116.2 U

21. What is the purpose of [Link]()? C116.2 R


PART – C
1. Explain user-defined functions in python with suitable examples. C116.2 U

Write a python program to demonstrate different types of arguments


2. C116.2 U
(positional, keyword default, variable-length)
3. Explain how lists can be passed to functions. Write an example program. C116.2 U

4. Describe recursion in python with an example program. C116.2 U

5. Explain classes and objects in python with an example. C116.2 U


Write a python program to C a class ‘Student’ with data members name, roll
6. C116.2 C
number, and marks. Include methods to display details.
7. Explain constructors and destructors in python with examples. C116.2 U
8. Explain different string methods in python with examples. C116.2 U
Write a python program to count vowels, consonants, digits, and write data
9. C116.2 C
into a text file.
Explain file handling in python. Write a program to read and write data into
10. C116.2 U
to a text file.
Differentiate between text files and binary files. Write a program to copy
11. C116.2 Az
contents from one file to another.
Explain exception handling in python with a program for divide-by zero and
12. C116.2 U
file-not-found errors.
13. Explain try, except, else, and finally blocks with suitable examples. C116.2 U
Explain the use of python’s built-in-libraries. Demonstrate math, datetime,
14. C116.2 U
and random modules with examples.
Develop any examples that demonstrates functions, string manipulation,
15. C116.2 C
files, class & object creation and exception handling.
UNIT III Foundations of Data Science

Introduction to Data Science- Applications of Data Science - Data Science Process: Overview, Defining
Research Goals, Retrieving Data - Data Preparation: Data Wrangling- Handling Missing Data- Data
Transformation, Outlier/Noise and Anomalies, Exploratory Data Analysis, Build the Model, Present
Findings, Data Mining, Data Warehousing.
PART - B
1. Define data science. C116.3 R
2. What is big data? C116.3 R
3. What is machine learning? C116.3 U
4. What is data mining? C116.3 R
5. What are the characteristics of big data? C116.3 R
6. List some of the application domains of data science? C116.3 U
7. State the importance of setting the research goal. C116.3 U
8. List the phases involved in the data science process. C116.3 U
9. What is meant by data cleaning? C116.3 U
10. What is project charter? C116.3 R
11. Identify the important contents of a project charter. C116.3 U
12. List the categories of data. C116.3 U
13. Define data. What are the types of data. C116.3 U
14. What is Qualitative data? Give example. C116.3 U
15. What is quantitative data? Give an example. C116.3 R
16. Compare Discrete and Continuous Variables. C116.3 U
17. Define approximate numbers. What is the approximate number of 7.2 and 8.8? C116.3 U
18. What is Frequency distribution? give the types. C116.3 R
PART – C
1. Illustrate the overview of the data science process. C116.3 U

2. Elaborate the application domains of data science. C116.3 U


3. Describe the categories of data for data mining. C116.3 U

4. Discuss the significance of setting the research goal for the data science project. C116.3 Az
Discuss the strategies involved in retrieving relevant data from different sources
5. C116.3 U
of data.
Elaborate the different ways to describe or represent data using tables with
6. C116.3 U
suitable examples.
Explain the various ways by which data can be represented or described using
7. C116.3 U
graphs with suitable examples and diagrams.
Explain the different measures of central tendency and describe the suitable
8. C116.3 U
measures for the different type of data distribution.
PART - C
Construct the frequency table and draw bar graph and leaf displays for the
1. C116.3 C
following data: 139, 145, 150, 145, 136, 150, 152, 144, 138, 138.
Construct the histogram and convert it to a frequency polygon for the following
2. data:138, 139, 139, 145, 150, 145, 136, 150, 152, 144, 138, 138, 150, 149, 133, C116.3 C
134, 155, 151.
UNIT IV Descriptive Analytics
Facets of Data, Types of Variables, Statistical Description of Data, Describing Data with Tables and Graphs,
Describing Data with Averages, Describing Variability, Normal Distributions and Standard (z) Scores,
Correlation, Scatter plots, correlation coefficient for quantitative data –computational formula for correlation
coefficient, Regression, Regression line, least squares regression line.
1. Define "Facets of Data" and list any four types. C116.4 R
State the difference between Discrete and Continuous variables with one
2. C116.4 R
example each.
3. Differentiate between Nominal and Ordinal scales of measurement. C116.4 U
Define the term "Skewness." What does a zero skewness indicate about the
4. C116.4 R
data?
Why is the Median considered a more "robust" measure of central tendency
5. C116.4 U
than the Mean in skewed distributions?
6. Define "Standard (z) Score." Write its formula. C116.4 R
7. What is the significance of the "Least Squares" principle in regression? C116.4 U
8. Define the Correlation Coefficient ($r$). What is its range of values? C116.4 R
9. Briefly explain the purpose of a Scatter Plot in bivariate data analysis. C116.4 U
10. Illustrate the difference between a Histogram and a Bar Graph. C116.4 U
11. Define Z-score and its significance in Data Science. C116.4 R
12. What is the "Empirical Rule" (68-95-99.7 Rule) for a Normal Distribution? C116.4 R
13. State the principle of "Least Squares" used in Linear Regression. C116.4 U
14. Differentiate between Correlation and Regression. C116.4 U
15. What is the difference between Discrete and Continuous variables? C116.4 R
PART - C
Discuss the various types of variables (Qualitative vs. Quantitative) and explain
1. the levels of measurement (Nominal, Ordinal, Interval, Ratio) with suitable C116.4 U
examples.
Explain the process of describing data with Tables and Graphs. Discuss the
2. specific scenarios where a Frequency Polygon and an Ogive curve would be C116.4 Ap
most appropriate.
Compare the three measures of central tendency (Mean, Median, Mode). Under
3. what conditions of variability and distribution shape would each be the C116.4 Az
preferred average?
Describe the various measures of variability (Range, Variance, and Standard
4. Deviation). Calculate the Standard Deviation for the following sample data: [12, C116.4 U
15, 18, 10, 22, 15, 13].
Elaborate on the properties of a Normal Distribution. Explain the "Empirical
5. C116.4 U
Rule" (68-95-99.7) and its importance in standardized testing.
6. Explain the computational formula for the Pearson Correlation Coefficient. C116.4 Ap
Demonstrate how to interpret different values of 'r'.
Discuss the concept of a Regression Line. Explain the relationship between the
7. independent variable (x̄ ) and the dependent variable (Ȳ) in a simple linear C116.4 Az
regression model.
PART - C
Comprehensive Calculation Case:

The following data represents the study hours ($X$) and exam scores ($Y$) of
10 students:

X: [2, 4, 5, 7, 8, 10, 12, 14, 15, 18]$


1. C116.4 Az
Y: [40, 45, 50, 65, 70, 72, 80, 85, 88, 95]$

Construct a Scatter Plot and identify the trend.


Compute the Pearson Correlation Coefficient.

Find the Least Squares Regression Line equation.

Critically evaluate the impact of outliers on various statistical descriptions.


2. C116.4 E
Discuss how outliers specifically affect the Mean, Standard Deviation, and the
Regression Line. Suggest methods to handle such data points.
Design a statistical reporting framework for a retail company to analyze
customer spending. The framework must include:
Identification of variable types (categorical vs. numerical).
3. A plan for describing data using averages and variability. C116.4 C

A method to predict future spending based on "income" using regression


analysis.

Justify the use of Standard (z) scores in comparing scores from two different
4. C116.4 E
distributions (e.g., comparing an SAT score to an ACT score). Explain the
transformation process and the role of the Standard Normal Table.
UNIT V Numpy and Pandas Libraries
Creating Arrays, attributes, Numpy Arrays objects, Basic operations (Array Join- split- search- sort), Indexing,
Slicing and Iterating, Copying Arrays, Arrays shape Manipulation, Identity Array, eye function. Exploring Data
using Series- Exploring Data using Data Frames, Index objects- reindex, Drop Entry, Selecting Entries- Data
Alignment, Rank and Sort, Summary Statistics, Index Hierarchy.
PART- B
1. What is NumPy? C116.5 R
2. How to C a NumPy array? C116.5 U
3. What are the attributes of a NumPy array? C116.5 R
4. What is the difference between a python list and a Numpy array? C116.5 U
5. What is a NumPy array object called? C116.5 R
6. How can arrays be joined in NumPy? C116.5 R
7. How can arrays be split in NumPy? C116.5 U
8. How to search for elements in a NumPy array? C116.5 U
9. How can arrays be sorted? C116.5 U
10. What does array broadcasting mean? C116.5 R
11. What is data visualization? C116.5 R
12. Mention any two features of data visualization. C116.5 U
13. What is Matplotlib? C116.5 R
14. What is the purpose of the [Link]() command? C116.5 R
15. Differentiate between Figure and Axes in Matplotlib. C116.5 U
16. What function is used to C subplots in Matplotlib? C116.5 U
17. What is the use of the labelpad parameter in axis labeling? C116.5 R
18. What is a legend in a plot? C116.5 R
19. How do you save a plot to a file in Matplotlib? C116.5 U
20. How do you load a CSV file in Pandas? C116.5 R
21. Explain the head() and tail() methods. C116.5 U
22. What is the purpose of [Link]()? C116.5 U
23. How do you handle missing values in a DataFrame? C116.5 R
24. Write the code to filter rows based on a condition. C116.5 R
25. Which function is used to annotate specific points in a plot? C116.5 U
26. What is the difference between loc and iloc? C116.5 U
PART – C
Explain the creation of arrays in NumPy with examples for different methods
1. C116.5 U
such as array(), arange(), linspace(), and Zeros(). Compare their use cases.
Describe in detail the important attributes of NumPy arrays. Write a python
2. C116.5 U
program to display the attributes ndim, shape, size, and typefor a given array.
Discuss on NumPy array objects? Explain the features and advantages of ndarray
3. C116.5 U
over traditional python lists with suitable examples.
Explain various basic operations that can be performed on NumPy arrays such as
4. C116.5 U
join, split, search, and sort with proper coding examples.
Discuss indexing, slicing and iterating operations in Numpy arrays. Demonstrate
5. C116.5 Az
how to access and manipulate elements using these techniques.
6. Explain the concept of subplots in Matplotlib with an example. C116.5 U
Describe how legends and annotations enhance the readability of data
7. C116.5 Az
visualization.
PART – C
Explain the difference between line plots, scatter plots, and bar plots with
1. C116.5 U
suitable examples.
Illustrate the significance of choosing appropriate visualization type for
2. C116.5 E
different kinds of data.
Explain the core data structures in the pandas library, Series and DataFrame.
Discuss their key features, how they differ from each other, and provide
3. examples of how each can be Cd. Furthermore, describe how pandas C116.5 Ap
facilitates efficient data loading from various file formats (e.g., CSV, Excel,
SQL databases).
Describe the essential steps involved in data cleaning and preprocessing
using pandas. Focus on methods for handling missing values (e.g., dropna(),
4. fillna(), interpolation), detecting and removing duplicate entries, and Aping C116.5 Ap
custom functions for data transformation. Provide explanations of relevant
pandas functions and when to use them.
Discuss the role of data aggregation in computing descriptive statistics for a
dataset using pandas. Explain the concepts of grouping data using groupby()
5. and Aping various aggregation functions (e.g., mean(), median(), describe()). C116.5 Ap
Use a hypothetical scenario (e.g., analyzing student scores by subject) to
illustrate the process and the insights gained.
UNIT VI Data Visualization
Introduction to Matplotlib, Plots, making subplots, Controlling axes, Ticks, Labels and legends, Annotations and
drawing on subplots, Saving plots to files, Seaborn library, Making sense of data through advanced visualization,
Controlling the properties of Chart, Scatter plot, Line plot, Bar plot, Histogram, Box plot, Pair plot, Styling your
plot, 3D plot of surface.
PART - B
Define the purpose of the %matplotlib inline magic command in Jupyter
1. C116.5 R
Notebooks.
2. Differentiate between [Link]() and [Link](). C116.5 U

3. List the parameters used in the [Link]() function to create a 2x2 grid. C116.5 R

4. How do you change the color and line style of a plot in Matplotlib? C116.5 U

5. What is the significance of the zorder attribute in Matplotlib? C116.5 U


State the command used to save a figure in high resolution (300 DPI) as a
6. C116.5 U
PNG file.
Why is Seaborn often preferred over Matplotlib for statistical data
7. C116.5 U
visualization?
8. Define "Hue" mapping in Seaborn and explain its utility. C116.5 U

9. What information does a Box Plot provide regarding data distribution? C116.5 U

10. Write the syntax to create a 3D surface plot using mplot3d. C116.5 U
PART – C
1. a) Explain the Matplotlib Object-Oriented interface in detail. Compare it C116.5 Ap
with the Pyplot state-machine interface.
b) Demonstrate how to customize Ticks, Labels, and Legends for a multi-line
graph.
Discuss the process of creating and managing subplots. Provide a Python
2. code snippet to draw four different types of charts in a single 2 × 2 figure C116.5 Ap
with a common title.
a) Explain the role of Annotations in data visualization. Write a script to
annotate the maximum value in a sine wave plot.
3. C116.5 Ap
b) Describe the various styling parameters available in Seaborn to enhance
plot aesthetics (set_style, set_context).
Compare and contrast Histogram and Bar Plot. Under what scenarios would
4. C116.5 Az
you choose a Pair Plot over a simple Scatter Plot? Justify with examples.
a) Explain how to visualize 3D surfaces using Matplotlib. Include the
5. importance of meshgrid in this process. C116.5 Ap
b) Write a program to generate a 3D surface plot

a) Propose a visualization strategy using Seaborn to identify correlations


between subjects.
1. C116.5 C
b) Develop a Python script to generate a Box Plot to detect outliers in marks
and a Pair Plot to see the overall trend.
a) Implement a Line Plot for sales trends, a Bar Plot for category-wise
revenue, and a Scatter Plot to show the relationship between discount and
2. C116.5 C
profit.
b) Apply custom styling, legends, and save the final output as a PDF file.
explain how you would use Heatmaps (via Seaborn) and 3D Surface Plots to
3. visualize temperature variations across different latitudes, longitudes, and C116.5 Az
altitudes. Justify your choice of color palettes for better readability.

Course Instructor HoD

You might also like