0% found this document useful (0 votes)
20 views

QB - 22ADS35 (Python For Data Science)

The document contains a question bank for the course 22ADS35: Python for Data Science offered by the Department of Artificial Intelligence and Data Science at GLOBAL ACADEMY OF TECHNOLOGY. The question bank contains questions divided into 5 modules covering topics such as NumPy, Pandas, data visualization with Matplotlib, data pre-processing, and machine learning concepts. Some example questions include describing NumPy array operations, demonstrating Pandas dataframes, creating plots and graphs, handling missing data, and explaining techniques like k-fold validation and data normalization.

Uploaded by

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

QB - 22ADS35 (Python For Data Science)

The document contains a question bank for the course 22ADS35: Python for Data Science offered by the Department of Artificial Intelligence and Data Science at GLOBAL ACADEMY OF TECHNOLOGY. The question bank contains questions divided into 5 modules covering topics such as NumPy, Pandas, data visualization with Matplotlib, data pre-processing, and machine learning concepts. Some example questions include describing NumPy array operations, demonstrating Pandas dataframes, creating plots and graphs, handling missing data, and explaining techniques like k-fold validation and data normalization.

Uploaded by

Arvind AS
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

GLOBAL ACADEMY OF TECHNOLOGY

Department of Artificial Intelligence and Data Science


Affiliated to VTU, Accredited by NAAC with 'A' grade
RR Nagar, Bengaluru – 560 098

22ADS35: Python for Data Science


Question Bank

Sl.No Questions

Module 1
1 Describe and implement the set operations on NumPy arrays.
2 Write a Python program to demonstrate the NumPy 2D array attributes
3 Describe and demonstrate any five array statistical methods
4 Demonstrate indexing and slicing on 2D NumPy arrays
5 Write a python program to implement Boolean indexing and fancy indexing on NumPy
arrays
6 Describe and demonstrate the NumPy array creation functions
7 Write a python program to perform the following linear algebra operations on NumPy arrays i) dot ii) trace iii)
solve iv) det
8 Discuss the aggregation functions available in NumPy.

9 Describe and demonstrate the reshape function on NumPy arrays


10 Write a python program to demonstrate transposing arrays and swapping axes on NumPy arrays

11 Write a python program to perform the following fast wise element operations on NumPy arrays i) sqrt ii)
square iii) exp iv) maximum
12
Module 2
1 Demonstrate the ranking methods on Series object
Define Pandas Series and Pandas DataFrame? Explain with an example
2 Demonstrate the concatenation of a Series and a Dataframe
3 Differentiate loc and iloc functions of pandas
4 Demonstrate the various Dataframe constructors.
5 Demonstrate merge functions of pandas: (a) Merge using multiple keys (b) Merge using
arithmetic set operations
6 Illustrate the row re-indexing, column reindexing and both row and column reindexing in
Pandas
7 Write a python program to merge two dataframes using key argument
8

Write a python program for indexing, selection and filtering in pandas series and data frames

Module 3
1 Create a plot and illustrate the following functions: title, ticks, limits, labels, legend, colors,
markers, linestyles.
2 Create subplots sharing (a) x axis only (b) y-axis only for the following expressions:
x.cumsum(), x.cumprod() given x = np.arange(1,5,1).
3 Write a program to create bar graph for the given data: data = {'AUDI':23, 'BMW':17, 'FORD':35,
'TESLA':29, 'JAGUAR':12, 'MERCEDES':41}

4 Write a program to create area plot on the given data:


x=range(1,6); y1=[1,4,6,8,9]; y2=[2,2,7,10,12]; y=[3.5,0,1.4,6,1].

5 Write a Python program illustrating stacking of three plots in horizontal direction.


6 Write a Python program to illustrate sharing of x-axis of a graph.

7 Write a Python program to create bar plot on the given data:


df = pd.DataFrame([[1, 5, 2],[3,4,5]], index=['one', 'two'], columns=['A', 'B', 'C'])
8 Write a Python program to create an area plot for the given data:
a = np.arange(1, 6)
b = np.array([3, 5, 1, 0, 4])
c = np.arange(6)
d = np.arange(4, 13.6, 2)
9 Write a Python programming to create a pie chart of the popularity of programming
Languages.

Sample data:
Programming languages: Java, Python, PHP, JavaScript, C#, C++
Popularity: 22.2, 17.6, 8.8, 8, 7.7, 6.7

Sample Solution:
Python Code:
import matplotlib.pyplot as plt
# Data to plot
languages = 'Java', 'Python', 'PHP', 'JavaScript', 'C#', 'C++'
popuratity = [22.2, 17.6, 8.8, 8, 7.7, 6.7]
colors = ["#1f77b4", "#ff7f0e", "#2ca02c", "#d62728", "#9467bd", "#8c564b"]
# explode 1st slice
explode = (0.1, 0, 0, 0,0,0)
# Plot
plt.pie(popuratity, explode=explode, labels=languages, colors=colors,
autopct='%1.1f%%', shadow=True, startangle=140)
plt.axis('equal')

plt.show()
10 Write a Python program to draw a line using given axis values with suitable label in the x
axis , y axis and a title.
Sample Solution:
Python Code:
import matplotlib.pyplot as plt
# x axis values
x = [1,2,3]
# y axis values
y = [2,4,1]
# Plot lines and/or markers to the Axes.
plt.plot(x, y)
# Set the x axis label of the current axis.
plt.xlabel('x - axis')
# Set the y axis label of the current axis.
plt.ylabel('y - axis')
# Set a title
plt.title('Sample graph!')
# Display a figure.
plt.show()
11

Module 4
1 Discuss handling missing data in Pandas.
2 Discuss pivoting Long to Wide format and Wide to Long format in pandas.
3 Demonstrate discretization and binning on the given data.
ages = [20, 202, 25, 27, 21, 23, 37, 31, 61, 45, 41, 101];
bins = [18, 25, 35, 60, 100].
4 Explain Reshaping with Hierarchical Indexing in DataFrame with an example
5 Write a python program for the following functions and explain it. i) Removing Duplicates
ii) Replacing Values iii) Renaming Axis Indexes
6 With an example explain Filtering Outliers
7 Write a python program to Create Dummy Variables for the following data

8 With a simple python program explain different merge functions


9 Explain the various concatenating functions with a simple python program
10

Module 5
1 With a neat diagram explain k fold process
2 Explain in detail different methods of data scaling
3 Explain the different methods to identify the outliers in the data
4 Explain different types data normalization methods
5 Explain the following data transformation techniques i) Linear ii) Quadratic iii)
Non-polynomial Approximations
6 With a neat diagram explain 5*2 fold process
7 Explain the following techniques in detail i) χ2 Correlation Test ii) Correlation Coefficient and
Covariance for Numeric Data

You might also like