2023
Dept of MCA, RNSIT
Lab Manual prepared by : Roopa.H.M.
Data Analytics Lab with Mini-Project
[As per Choice Based Credit System (CBCS) scheme]
III SEMESTER
Laboratory Code: 22MCAL36
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
Data Analytics Lab with Mini-Project
PART – A
Sl.no Experiments Pg.NO
1. Write a Python program to perform linear search 3
2. Write a Python program to insert an element into a sorted list 4
3. Write a python program using object oriented programming to demonstrate encapsulation,
5
overloading and inheritance
4. Implement a python program to demonstrate
1) Importing Datasets 6
2) Cleaning the Data
3) Data frame manipulation using NumPy
5. Implement a python program to demonstrate the following using NumPy
a) Array manipulation, Searching, Sorting, and splitting. 10
b) broadcasting and Plotting NumPy arrays
6. Implement a python program to demonstrate Data visualization with various Types of
15
Graphs using Numpy
7. Write a Python program that creates a mxn integer arrayand Prints its attributes using
18
matplotlib
8. Write a Python program to demonstrate the generation of linear regression models. 19
9. Write a Python program to demonstrate the generation of logistic regression models
using Python. 21
10. Write a Python program to demonstrate Timeseries analysis with Pandas. 23
11. Write a Python program to demonstrate Data Visualization using Seaborn. 27
PART B
1. Students shall carry out a mini project using python/pandas to demonstrate the data analysis.
2. A team of two students must develop the mini project. However, during the examination, each
student must demonstrate the project individually.
3. The team must submit a brief project report (20-25 pages) that must include the following
a) Introduction
b) Requirement Analysis
c) Software Requirement Specification
d) Analysis and Design
e) Implementation
f) Testing
4. Brief synopsis not more than two pages to be submitted by the team as per the format given. It is
recommended that students to do prior art search as part of literature survey before submitting the synopsis
for the Mini/Major projects.
5. Rubrics may be used to evaluate the Mini-Project Each students has to execute one program picked from Part-
A during the semester end examination. In SEE Part-A and Part-B shall be given 50% weightage each.
ROOPA.H.M, DeptofMCA, RNSIT Page 2
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
Program : 1 Write a Python program to perform linear search
ROOPA.H.M, DeptofMCA, RNSIT Page 3
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
Program : 2 Write a Python program to insert an element into a sorted list
Approach :
Python comes with a bisect module whose purpose is to find a position in list where an element needs to be
inserted to keep the list sorted. Thus we use this module to solve the given problem.
Alternate Code: with using any module
ROOPA.H.M, DeptofMCA, RNSIT Page 4
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
Write a python program using object-oriented programming to
Program : 3
demonstrate encapsulation, overloading and inheritance.
Output:
ROOPA.H.M, DeptofMCA, RNSIT Page 5
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
Program : 4 Implement a python program to demonstrate
1) Importing Datasets
2) Cleaning the Data
3) Data frame manipulation using Numpy
Note : Toyoto.csv file can be Download here
https://drive.google.com/file/d/111Sey6b_iCmazE_WaML2aHisyiwVpQ_n/view?usp=sharing
ROOPA.H.M, DeptofMCA, RNSIT Page 6
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
ROOPA.H.M, DeptofMCA, RNSIT Page 7
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
ROOPA.H.M, DeptofMCA, RNSIT Page 8
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
ROOPA.H.M, DeptofMCA, RNSIT Page 9
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
Program : 5 Implement a python program to demonstrate the following using NumPy
a) Array manipulation, Searching, Sorting and splitting.
b) Broadcasting and Plotting NumPy arrays
ROOPA.H.M, DeptofMCA, RNSIT Page 10
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
ROOPA.H.M, DeptofMCA, RNSIT Page 11
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
ROOPA.H.M, DeptofMCA, RNSIT Page 12
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
ROOPA.H.M, DeptofMCA, RNSIT Page 13
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
ROOPA.H.M, DeptofMCA, RNSIT Page 14
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
Program : 6 Implement a python program to demonstrate Data visualization with
various Types of Graphs using matplotlib
ROOPA.H.M, DeptofMCA, RNSIT Page 15
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
ROOPA.H.M, DeptofMCA, RNSIT Page 16
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
ROOPA.H.M, DeptofMCA, RNSIT Page 17
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
Program : 7 Write a Python program that creates a mxn integer arrayand Prints its
attributes using Numpy
ROOPA.H.M, DeptofMCA, RNSIT Page 18
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
Program : 8 Write a Python program to demonstrate the generation of linear regression
models.
About Linear regression models
Linear regression models are useful in a variety of situations where we want to model the relationship between
a dependent variable and one or more independent variables.
Some examples of situations where linear regression models may be useful include:
• Predicting future outcomes: Linear regression models can be used to make predictions about future outcomes
based on historical data. For example, a linear regression model might be used to predict future sales of a
product based on past sales data.
• Understanding relationships between variables: Linear regression models can help us understand how
changes in one variable affect another variable. For example, a linear regression model might be used to
understand how changes in advertising spending affect sales.
• Identifying important variables: Linear regression models can be used to identify which variables are most
important in predicting the value of the dependent variable. This can be helpful in determining which variables
to focus on when trying to improve outcomes.
• Testing hypotheses: Linear regression models can be used to test hypotheses about the relationship between
variables. For example, a researcher might use a linear regression model to test whether there is a statistically
significant relationship between income and education level.
Overall, linear regression models are useful in a wide range of situations where we want to model the relationship
between variables and make predictions based on that relationship.
ROOPA.H.M, DeptofMCA, RNSIT Page 19
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
Output:
ROOPA.H.M, DeptofMCA, RNSIT Page 20
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
Program : 9 Write a Python program to demonstrate the generation of logistic
regression models using
Description
• In this program, we first generate some sample data in the form of an array X of features and an
array y of corresponding target values. In this case, the target values are binary, with a value of 0
indicating one class and a value of 1 indicating another class.
• We then create a LogisticRegression object and fit the model to the data using the fit() method.
• We can then print the coefficients and intercept of the logistic regression model using the coef_ and
intercept_ attributes of the model object. Finally, we use the trained model to predict new data using
the predict() method and print the predictions.
• Note that the logistic regression model is commonly used for binary classification problems where
the target variable is binary. If the target variable has more than two classes, we can use multiclass
logistic regression (also known as softmax regression) to make predictions
ROOPA.H.M, DeptofMCA, RNSIT Page 21
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
Output:
ROOPA.H.M, DeptofMCA, RNSIT Page 22
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
Program : 10 Write a Python program to demonstrate Time series analysis with Pandas.
Description: In this program, time series analysis is done to apple stock market price . you can download
the csv file here
https://drive.google.com/file/d/1MMiDz4c9iQPrOvDn4nHiuJB5hJv67qeo/view?usp=sharing
ROOPA.H.M, DeptofMCA, RNSIT Page 23
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
Average price of aapl's stock in June, 2017
ROOPA.H.M, DeptofMCA, RNSIT Page 24
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
Select Date Range
Resampling
Visualization of the analysis
ROOPA.H.M, DeptofMCA, RNSIT Page 25
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
ROOPA.H.M, DeptofMCA, RNSIT Page 26
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
Program : 11 Write a Python program to demonstrate Data Visualization using Seaborn
Note : Toyoto.csv file can be Download here
https://drive.google.com/file/d/111Sey6b_iCmazE_WaML2aHisyiwVpQ_n/view?usp=sharing
ROOPA.H.M, DeptofMCA, RNSIT Page 27
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
ROOPA.H.M, DeptofMCA, RNSIT Page 28
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
ROOPA.H.M, DeptofMCA, RNSIT Page 29
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
ROOPA.H.M, DeptofMCA, RNSIT Page 30
LAB MANUAL [22MCAL36] Data Analytics Lab with Mini-Project
ROOPA.H.M, DeptofMCA, RNSIT Page 31