QB - 22ADS35 (Python For Data Science)
QB - 22ADS35 (Python For Data Science)
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.
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}
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
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